聯系我們 - 廣告服務 - 聯系電話:
您的當前位置: > 關注 > > 正文

環球熱點評!night24_Excel 2010條件格式夢Night 如何在列表中分隔日期?

來源:CSDN 時間:2022-12-29 13:54:31

night24

[Updated June 2018] I"m a big fan of Excel"s conditional formatting, and often use it to highlight cells on a worksheet. But this week I ran into a conditional formatting nightmare, and had to start from scratch. Fortunately, the fix didn"t take too long, but with complex formatting, things could have been much worse.

[2018年6月更新]我是Excel 條件格式的忠實擁護者 ,經常使用它來突出顯示工作表中的單元格。 但是這周我遇到了有條件的格式化夢night,不得不從頭開始。 幸運的是,修復并沒有花費太長時間,但是使用復雜的格式,情況可能會變得更糟。


(資料圖片)

分隔列表中的日期 (Separate the Dates in a List)

There are lots of ways to use Excel conditional formatting. It"s useful for alerting people to problems, hiding duplicate values in a column, or even hiding cells" contents, until related cells are filled correctly.

有很多使用Excel條件格式的方法。 這對于提醒人們出現問題,在列中隱藏重復的值,甚至隱藏單元格的內容非常有用,直到正確填充相關單元格為止。

Earlier this year, I posted a tip for separating dates in a list, by using a red border at the start of a date change.

今年早些時候,我發布了一個技巧,用于在列表中分隔日期 ,方法是在日期更改開始時使用紅色邊框。

更容易閱讀 (Easier to Read)

It"s a technique that I use in one of my own workbooks, which I update every morning. The red border really makes the list easier to read, especially if I"m looking at it before my morning coffee!

我每天早上都會更新自己的一本工作簿中使用的這項技術。 紅色邊框確實使該列表更易于閱讀,尤其是如果我在早上喝咖啡之前正在看的時候!

The conditional formatting was set for cells A2:F9, and uses a simple formula to see if the date is equal to the date in the row above.

為單元格A2:F9設置了條件格式,并使用一個簡單的公式查看日期是否等于上一行中的日期。

快速復制和粘貼 (Quick Copy and Paste)

In the workbook, I track some daily statistics for my website, and use the same headings every day. So, to save typing time, I copy and paste the headings from the day before.

在工作簿中,我跟蹤網站的一些日常統計數據,并每天使用相同的標題。 因此,為節省鍵入時間,我復制并粘貼了前一天的標題。

For example, in the screen shot above, I could copy the regions and products headings from B2:C4, and paste them into cell B10:C12, for the latest day"s data.

例如,在上面的屏幕快照中,我可以從B2:C4復制區域和產品標題,并將它們粘貼到單元格B10:C12中,以獲取最新的日期數據。

The Excel table automatically expands to include the new rows, and fills in the formulas in column F. Awesome!

Excel表將自動展開以包括新行,并在F列中填寫公式。太棒了!

And that copy and paste trick is what I"ve been doing every day, for months on end.

這個復制粘貼技巧就是我連續幾個月都在做的事情。

線路故障 (Trouble With the Lines)

Suddenly, this week, I started having trouble with the red border between dates – it wasn"t going across the full table.

突然,這個星期,我開始遇到日期之間的紅色邊框的麻煩–它沒有遍及整個表格。

So, I went into the Conditional Formatting Manager, to fix the problem. But, instead of one simple rule, there were hundreds of rules!

因此,我進入條件格式管理器來解決此問題。 但是,不是一個簡單的規則,而是數百個規則!

You can see the tiny scroll box at the bottom right in the screen shot below. That should give you some idea of how long that list was.

您可以在以下屏幕截圖的右下方看到微小的滾動框。 這應該使您知道該列表有多長時間。

Every time that I copied and pasted within the conditional formatting range, it created another rule for the worksheet. Yikes!

每次我在條件格式范圍內復制和粘貼時,它都會為工作表創建另一個規則。 kes!

Let"s take a look at the smaller example, where I just copied and pasted the Region and Product headings. Now, it has two rules, instead of one, after one copy and paste within the table.

讓我們看一下較小的示例,在該示例中,我剛剛復制并粘貼了Region和Product標題。 現在,它有兩個規則,而不是一個,一個是復制并粘貼到表中。

清理混亂-更新 (Cleaning Up the Mess - UPDATED)

UPDATE - March 2017: I"ve found a quicker way to fix the problem, as you can see in this video. Get the detailed steps on my Conditional Formatting page.

更新-2017年3月:正如您在本視頻中所看到的,我找到了解決此問題的更快方法。 在“ 條件格式”頁面上獲取詳細步驟。

演示地址

The previous solution is listed below, in case you"d rather try that.

如果您愿意嘗試一下,下面列出了以前的解決方案。

清理混亂-原始解決方案 (Cleaning Up the Mess - ORIGINAL SOLUTION)

I scrolled through the list, and deleted a few of the rules, but quickly realized that it would take far too long to delete all of them. So, to clean up the mess, I cleared the conditional formatting from the worksheet, and set it up again.

我滾動瀏覽列表,并刪除了一些規則,但很快意識到刪除所有規則將花費很長時間。 因此,為清理混亂,我從工作表中清除了條件格式,然后再次進行設置。

With all the extra rules gone, the conditional formatting borders were working correctly again.

隨著所有其他規則的消失,條件格式設置邊框再次正常工作。

避免條件格式化夢Night (Avoid Conditional Formatting Nightmare)

Now, when I want to save some typing time in the daily list, I copy the previous headings, and use the Paste Values button to create the new records. I"ve got a copy of that button on Excel"s Quick Access Toolbar, so it"s easy to click.

現在,當我想在每日列表中節省一些鍵入時間時,我復制了以前的標題,并使用“粘貼值”按鈕來創建新記錄。 我在Excel的快速訪問工具欄上有該按鈕的副本,因此很容易單擊。

That adds the text, and the table expands, including the formulas – but the conditional formatting doesn"t create a new rule.

這樣就添加了文本,表格也進行了擴展,包括公式-但條件格式不會創建新規則。

Be careful out there -- don"t let this conditional formatting nightmare happen to you!

小心點-不要讓這種條件格式化的噩夢發生在您身上!

另一種解決方案 (Another Solution)

Update: Thanks to Khushnood, who suggested leaving 3 blank rows at the bottom of the table, and inserting new rows above that, when adding new data.

更新:感謝Khushnood的建議,他建議在表底部保留3個空白行,并在添加新數據時在其上方插入新行。

Copy and pasting within the table doesn"t seem to produce the duplicate conditional formatting.

在表中進行復制和粘貼似乎不會產生重復的條件格式。

It"s still an extra step though, instead of a simple copy and paste. ________________

但是,這仍然是一個額外的步驟,而不是簡單的復制和粘貼。 ________________

night24

責任編輯:

標簽:

相關推薦:

精彩放送:

新聞聚焦
Top 岛国精品在线