Hi everyone,
Thanks for you wisdom and knowledge.
I have VBA code to create a unique list of names from a repetitive list of names. The list of names is 32 long including the header row, and has 5 unique names.
My goal is to create a unique list of names on Worksheets("Seniors List"). The code worked for me yesterday, but it is not working today. Any ideas why this would occur? How can I get this to work consistently?
Thanks in advance!
Thanks for you wisdom and knowledge.
I have VBA code to create a unique list of names from a repetitive list of names. The list of names is 32 long including the header row, and has 5 unique names.
My goal is to create a unique list of names on Worksheets("Seniors List"). The code worked for me yesterday, but it is not working today. Any ideas why this would occur? How can I get this to work consistently?
Code:
Dim w As Worksheet, s As Worksheet
Dim lastSeniorRow As Long
Set w = Worksheets("ACE Locations")
Set s = Worksheets("Seniors List")
s.Range("A:A").Clear 'Clear the existing list
lastSeniorRow = w.Cells(Rows.Count, 9).End(xlUp).Row ' =32
w.Range(w.Cells(1, 9), w.Cells(lastSeniorRow, 9)).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=w.Columns("A:A"), Unique:=True