View Full Version : Change color on excel sheet from Access


bugsy
11-15-2007, 04:17 PM
Hey

I have access query opening in excel. After it opens i would like everywher where where is says "no", to make next 2 cells BLUE.

The code below is doing it, but it's taking few minutes.
is there any way to speed it up ?


'shading non-matching items
With objActiveWkb.Worksheets("Reconciliation Sheet").Range("b5:ak500")
Set c = .Find("No", , , xlWhole, , , True)
If Not c Is Nothing Then
sAddress = c.Address
Do
c.Offset(, -2).Resize(, 3).Interior.Pattern = xlSolid
c.Offset(, -2).Resize(, 3).Interior.ColorIndex = 33
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> sAddress
End If
End With

KeithG
11-15-2007, 04:38 PM
Have you tried conditonal formatting?

bugsy
11-15-2007, 05:25 PM
Have you tried conditonal formatting?

hey Keith
i am afraid i don't know how with Conditional Formatting format cell other then the one(s) you looking at.
i.e. If cell (c5) = NO, i'd like cells (C3:24) to become green.