Excel VBA: What is wrong with this code?

1 reply [Last post]
User offline. Last seen 3 years 14 weeks ago. Offline
Joined: 10/26/2008
Posts: 11

Sub populateSchI()

Dim chargeNo As Range
Dim concat As Range

Set chargeNo = Worksheets("Schedule I").Range("A6")

For Each concat In Worksheets("2008").Range("D:D")
If concat.Value = chargeNo.Value Then
concat.Offset(0, 7).Value = "It worked"
End If
Next concat

End Sub

chargeNo and concat (range objects) are on two different tabs.

User offline. Last seen 2 years 2 weeks ago. Offline
Joined: 01/18/2010
Posts: 2
I do not think there is

I do not think there is anything wrong with the code - I ran it and its fine. what do you want that code to do?

with me when it found a match it added "It worked" to 7 columns away from col D ... column K