Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change font if item above is not hidden
I have a macro that hides duplicate entries in a row. I have the word
'Science" in range A3:A36. Range A37:A106 has the word "Economics". Row A9 is hidden. When I run the macro below, A3 has Science and A37 has Economics and the rest of the items are hidden (white font). On the off-chance that rows 3 or 37 are hidden (before the macro is run) how can I make sure that A4 or A38 can be viewed? That is, if the first item is hidden don't change the font color to white on the second so that someone viewing the spreadsheet will know the subject area of the book list. Thanks for your help -- and I hope I have explained the issue intelligibly. 'Macro changes font color on duplicates 'regardless of whether the first row is hidden 'If value of cell above is equal to current cell, 'change to white Dim DataRng As Range Dim CellRng As Range Set DataRng = Range(ActiveCell, ActiveCell.Resize(Selection.Rows.Count + 3000)) For Each CellRng In DataRng If CellRng.Offset(-1, 0).Value = CellRng.Value Then CellRng.Font.ColorIndex = 2 End If Next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change scaling % but font size didnt change porportionally, pls he | Excel Discussion (Misc queries) | |||
Change all text one font size up with various font sizes used. | New Users to Excel | |||
Highlight entire document and try to change font - won't change. | Excel Discussion (Misc queries) | |||
Org Chart Item Automatic Font | Charts and Charting in Excel | |||
change display font to actual selected font | Excel Discussion (Misc queries) |