do a loop in excel sheet from Access

bugsy

Registered User.
Local time
Today, 01:45
Joined
Oct 1, 2007
Messages
99
hey group
How can i have something like this loop to run from ccess application which is already currently opn and where work is done ?

Code:
With objActiveWkb.Worksheets("Reconciliation Sheet")
For ii = 5 To 200
    If Range(ii, 9) = "NO" Then
        Range(ii + 1, 9).Interior.ColorIndex = "yellow"
    End If
Next
End With
 
Can you expand on your question a little? I don't understand what you want to accomplish.
 
Hey Keith

I have query opening to excel template.
At some point 2 records right of each "no" statement are colored blue

Code:
'shading non-matching items
With objActiveWkb.Worksheets("Reconciliation Sheet").Range("b5:an500")
    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

I would also like to color yellow
left 2 cells from column I, where value is "no"
 

Users who are viewing this thread

Back
Top Bottom