PDA

View Full Version : [SOLVED] Unhighlight cells



austenr
11-29-2004, 09:17 PM
Having gotten my matching program to work, I added a part that highlights the changes in the cells. How can I remove the highlights? I know I have seen it before but can't remember how to do it. Thanks.

johnske
11-29-2004, 09:52 PM
Hi Austen,

You mean something like this maybe?


Option Explicit
Sub RemoveColour()
Dim c, FirstAddress
'//put your own range in here
With Worksheets(1).Range("a1:g500")
Set c = .Find(what:="*", LookIn:=xlValues)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
c.Select
c.Interior.ColorIndex = 0
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
End If
End With
End Sub[/vba]
Or, if what you're doing lends itself to a simpler method > [vba]Sub RemoveFill()
Range("A1:G500").Interior.ColorIndex = 0
End Sub

austenr
11-29-2004, 10:00 PM
Thanks Johnske