question

Dano9479-3581 avatar image
0 Votes"
Dano9479-3581 asked cooldadtx commented

VBS Scripting Help

Hello friends,
Was hoping to get some help on creating a vb script to highlight some data.

In a spreadsheet, in column F, I have a certain value highlighted. I need to be able to find that highlighted value (EBB Access) and have the cell immediately below it highlight (or change font or something to easily identify it).


197141-image.png





Any help would be very much appreciated.

office-scripts-excel-dev
image.png (13.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

Rather than using a script why don't you use conditional formatting instead. Given the column you could apply the conditional format expression =INDIRECT(ADDRESS(ROW()-1,COLUMN()))="EBB Access" to the column. Any row that is immediately preceded by a row with that value in the same column would then be formatted how you want.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dano9479-3581 avatar image
0 Votes"
Dano9479-3581 answered cooldadtx commented

Thanks for the info but, I'm an idiot and am having trouble getting it to work.
In the conditional formatting formula I am entering =INDIRECT(ADDRESS(ROW(3)-1,COLUMN(7)))="EBB Access" to no avail. Tried may other combos too.
If the starting row is at row 3 for all of column G, what should that look like? Can't thank you enough.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Don't put any #s in the ROW or COLUMN functions.

  1. Select the column header in Excel to select the entire column.

  2. Under the Home ribbon bar select Conditional Formatting.

  3. Click the Manage Rules and add a new rule for this formula.

  4. Put the formula in exactly as I provided.

  5. Set the Format to whatever formatting you want.

  6. Set the Applies to to the range of the columns (e.g. $F).

  7. Click Apply.


The formula will take each row, look at the value in the previous row's column (`ADDRESS(ROW()-1, COLUMN()`) and if it matches the value given then set's the current row's column formatting accordingly.


0 Votes 0 ·