S
Sherry
This code below reads 2 files and figures out that B2 in one file may or may
not match something in column CN in the other file. I don't really
understand how it works - some kind person here gave me the code. If the
macro finds a match it flags it by entering text 8 columns away from Column
CN. My problem is it only does this for one match. If mutiple records match
only one is flagged and the others get no flag. Can someone tel me how to
make it flag ALL records that match? It would make a nice Christmas present
for me.
Thanks
Sub MergeIt(File1, File2)
For Each strname In Workbooks(File1).Sheets("Sheet1").Range("b2:b800")
With Workbooks(File2).Sheets("Sheet1").Range("cn2:cn10000")
Set c = .Find(strname, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
c.Offset(0, 8) = "This one Matches"
End If
End With
Next
End Sub
not match something in column CN in the other file. I don't really
understand how it works - some kind person here gave me the code. If the
macro finds a match it flags it by entering text 8 columns away from Column
CN. My problem is it only does this for one match. If mutiple records match
only one is flagged and the others get no flag. Can someone tel me how to
make it flag ALL records that match? It would make a nice Christmas present
for me.
Thanks
Sub MergeIt(File1, File2)
For Each strname In Workbooks(File1).Sheets("Sheet1").Range("b2:b800")
With Workbooks(File2).Sheets("Sheet1").Range("cn2:cn10000")
Set c = .Find(strname, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
c.Offset(0, 8) = "This one Matches"
End If
End With
Next
End Sub