Consulting

Results 1 to 3 of 3

Thread: Unhighlight cells

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Unhighlight cells

    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.

  2. #2
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    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
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks Johnske

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •