I have three workbooks. Workbook 1 has a column of phone numbers that I need to compare to workbook 2 column of phone numbers. Then transfer match and non-match phone numbers to workbook 3. My issue is moving to the next row for each workbooks 2 and 3 and if I should nest the codes then loop back to the start of the code. I am using a userform command button to start the search. I think the issue maybe that the VBA code is not identiying the workbook 2 and 3.
Please suggect any videos that will help me learn how to use VBA for this process too.
Sub Button4_Click()
Dim Copy_1 As Range, Copy_2 As Range
Dim Workbook 1 As Workbook
For Each Count In Range(Range("A2"), Range("A2").End(xlDown))
For Each Count In Range(Cells(1, 1), Cells(10, 1))
Do Until IsEmpty(ActiveCell)
Workbooks("Workbook 1.xlsx").Activate
Worksheets("Copy 1").Range("A2").Activate
Do Until Worksheets("Copy 1").Range("A:A").Value = ""
NumRows = Range(Range("A1"), Range("A1").End(xlDown)).Rows.Count
Set Copy_1 = Range("A:A").Find(what:=Range("A2").Value, LookIn:=xlValues, LookAt:=xlWhole)
Range("A2").Offset(1, 0).Select
If Not UserForm Is Nothing Then
Workbooks("Workbook 3").Worksheets("Match").Range("A:A").Value = Workbook_1.Value
On Error Resume Next
Set Answers = Activeworkbooks.Sheets("Match")
Workbooks("Workbook 3").Worksheets("Match").Range("A2").Offset(1, 0).Select
ActiveCell.Offset(1, 0).Select
Else
Workbooks("Workbook 3").Worksheets("Non-match").Range("A:A").Value = Workbook_1.Value
Workbooks("Workbook 3").Worksheets("Non-match").Range("A2").Offset(1, 0).Select
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub