Xcel Highlight Macro
Posted by Peter Crymble on October 24, 2001 5:31 AM
Hi
Thanks Juan Pablo for your previous reply. I want to select & highlight the top few cells no matter what filter is applied e.g. row 60 on screen - needs highlighted if row 1. Current code is as suggested:
Range("B2:AV3").SpecialCells(xlCellTypeVisible).Select.Range("B2:AV2").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
However, with the filter applied I get the following error: "No cells found". Could you explain the code and how to get around this? Thanks so much for all the help so far - mrexcel is great!
PEter
============
ORIGINAL REPLY BELOW:
Change Range("A2:AV2") to
Range("A2:A40").SpecialCells(xlCellTypeVisible).Range("A1:AV2")
You need to adjust the first Range, A2:A40 to your needs.
Juan Pablo
======================
ORIGINAL QUESTION BELOW: