Automatic Highlight On Cues

seeke

New Member
Joined
Jul 13, 2012
Messages
4
I'm having to highlight different groups of rows (thousands, or 10 thousands of rows). It seems like I would need a script to do this quickly, and I have no knowledge of scripting.

Here's what I want to do:

Layout of my sheet: On Column A, there are 3 types of cells: letters, a "#" (yes, just a "#" in that whole cell), then blank. So the column would go like this: a cell of letters, a cell of # (right underneath), cell of blank, cell of blank, blank... then a new cell of letters, then a "#" underneath, then so on and so far.
What prevents me from setting a automatic highlighting after a certain of rows is because of number of rows with blanks varies (sometime, 100 of them), meaning there is a variable gap between the Cell of letters and cell of "#".

I hope there is some way to write a code for automatic highlighting: a color for the whole group of [cell of letters, cell of #, then as many cell of blanks] under them till there's a new cell of letters. To clarify, there will be alternating color of each group of [cell of letters, cell of #, cells of blanks]; and the whole rows

With my non-existent coding experience, I'm thinking the "#" could act as anchor for the highlighting script.

Linked is an image of the sample sheet; I'm using excel 2010 windows, and the 2 highlight colors are "Note" and "Input";

Imageshack - ashampoosnap2012090923h.png

Thank you very much in advance!

-S
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Here's a method without using VBA. (Conditional formatting with a helper column).

Based on your screenshot, I'll assume your data is within A1:D1000 for example purposes.

- Highlight the data range and format it one of your color fills (say light orange). Add gridlines.
- In E1, type the number 1
- In E2, write the formula: =IF(D3="Message",E1*-1,E1)
- Copy down the length of your data. You can hide this column if you wish.
If things are going right, you should notice that the 1s and -1s should correspond to your groups of data that you want to color differently.

- Highlight the data range, starting with A1
- Conditional Formatting> Manage Rules > New Rule >Use formula: =$E1=1, format fill as the other color (light yellow).
- Done

In later versions of the file, you can simply copy the formula and formatting down to the length of data you have.
 
Upvote 0

Forum statistics

Threads
1,225,156
Messages
6,183,246
Members
453,152
Latest member
ChrisMd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top