Hello!
I have two sheets.
Sheet 1(NOM ROLL) has with id numbers in col A and spaces in col E and F.
Sheet 2(JMES) has a subset of the id numbers in col B and in Cols J & k, strings.
I need to find the matching ids in (s1)A and (s2)B and where they match, copy in (s2)J&K into (s1) E&F.
Below is what i've come up with however its returning a error 9, subscript out of range.
Any help would be much appriciated!
I have two sheets.
Sheet 1(NOM ROLL) has with id numbers in col A and spaces in col E and F.
Sheet 2(JMES) has a subset of the id numbers in col B and in Cols J & k, strings.
I need to find the matching ids in (s1)A and (s2)B and where they match, copy in (s2)J&K into (s1) E&F.
Below is what i've come up with however its returning a error 9, subscript out of range.
Any help would be much appriciated!
Code:
Dim d As Range, c As Range, b As Range
With Sheets("NOM ROLL")
If FilterMode = True Then .ShowAllData
Range("A3", Range("A" & Rows.Count).End(xlUp)).Interior.ColorIndex = xlNone
For Each d In Range("A3", Range("A" & Rows.Count).End(xlUp))
Set c = Sheets("JMES").Find(d.Value, lookat:=xlWhole).Offset(0, 8).Value
Set b = Sheets("JMES").Find(d.Value, lookat:=xlWhole).Offset(0, 9).Value
If Not c Is Nothing Then
d.Offset(0, 4).Value = c
d.Offset(0, 5).Value = b
Set c = Nothing
Set b = Nothing
GoTo MyLoop
End If
MyLoop: Next d
End With
End Sub