I have 2 sets of data that have to be matched based on one identifier that they both have in common (Range 1 is on Sheet1 and it runs from Column A:F, Range2 is on Sheet3 and runs from Column A:M). The matching values for both ranges will occur in Column E for Sheet1 and Column C for Sheet3. I tried to record a macro to see if I could create a simple loop to just repeat what I was doing until it ran into any irregular data, but I ran into the issue of how to loop the actions that I was doing. Here is my code:
Sub Record_And_Destroy()
'first issue is writing a loop that will cycle through all rows in column E
'starting in row 18 in this example
Range("E18").Select
Selection.Copy
Sheets("Sheet3").Select
'Sheet3 contains the second table of data
'I want to search based on the copied value from Sheet1...
*Cells.Find(What:="03885740-131601", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate*
'The data that is being matched is in column C of Sheet3 but I need all columns A:M that
'are associated with the found match
Range("A10:M10").Select
Application.CutCopyMode = False
Selection.Cut
Sheets("Sheet1").Select
Range("G18").Select
'Column G is the next available column when matching to Sheet1 so every other selection
'would be placed in Column G but the row would differ based upon
'which row was being searched
ActiveSheet.Paste
Sheets("Sheet3").Select
Selection.Delete Shift:=xlUp
'this way I clean up the data base to only contain the "problem" cases
End Sub
Question 1: is there a way to use Cells.Find to search for the selection as opposed to the value?
Question 2: In the event that the loop found no matches, is there a way to format rows G:S on Sheet1 to display a red background so that I would know to go back and check those values once the loop had concluded?