Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change scaling % but font size didnt change porportionally, pls he Scaling question Excel Discussion (Misc queries) 0 March 12th 07 03:16 AM
Change all text one font size up with various font sizes used. omchrystal New Users to Excel 2 March 6th 07 09:01 PM
Highlight entire document and try to change font - won't change. murzy03 Excel Discussion (Misc queries) 1 May 8th 06 07:05 PM
Org Chart Item Automatic Font Charlie Charts and Charting in Excel 0 October 12th 05 03:50 PM
change display font to actual selected font Flannigan Excel Discussion (Misc queries) 1 August 30th 05 01:46 PM


All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"