I'm trying to take a list of names on one sheet, check to see if it appears on a second sheet, and if it does, display on a third sheet the name and the number of times it appears.
I found some code elsewhere and attempted to adapt it for my purposes. I've used Do Until IsEmpty to run through the first worksheet and two nested IF statements to check if the name appears on the second sheet, and COUNTIF to tally them.
I thought I'd gotten everything correct, but when I try the macro it runs for a moment then hangs up and freezes. I'm very new at VBA and have probably made some very simple mistakes, but I'm not familiar enough to with VBA to find the error.
Below is the code that I'm using.
Sub NS_FPS_Macro()
Dim NSName As String
Dim FPSCount As String
Application.ScreenUpdating = False
NSName = Worksheets("Summary_Report").Range("B2").Select
Do Until IsEmpty(Worksheets("Summary_Report").Range("B:B"))
Sheets("FPS_Report").Activate
If ActiveCell.Value = NSName Then
Found = True
End If
If Found = True Then
FPSCount = Application.WorksheetFunction.CountIf(Range(Worksheets("FPS_Report").Range("B:B")), NSName)
Destination = Sheets("Report").Cells(Rows.Count, "A").End(xlUp).Offset(1)
End If
ActiveCell.Offset(1, 0).Select
Loop
Application.ScreenUpdating = True
End Sub