I would do this by using autofilter and copying.
See attachment - checkboxes are linked to their cells behind and they have the same macro "test" assigned.
thus way it is particularily easy to add next years results etc.
I left only small piece of data, because I don't like uploading that large file to forum server.
Sub test()
Dim lastrow As Long
Application.ScreenUpdating = False
Range(Cells(3, "A"), Cells(Rows.Count, "A").End(xlDown).Offset(0, 9)).ClearContents
If Range("B1") Or Range("C1") Or Range("D1") Or Range("E1") Then
With Sheets("Registered Voters")
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range("$A$1:$CH$" & lastrow)
If Range("E1") Then .AutoFilter Field:=84, Criteria1:="P" ' 2006
If Range("D1") Then .AutoFilter Field:=81, Criteria1:="P"
If Range("C1") Then .AutoFilter Field:=78, Criteria1:="P"
If Range("B1") Then .AutoFilter Field:=75, Criteria1:="P"
End With
.Range("D2:D" & lastrow).Copy Range("A3") 'last names
.Range("B2:B" & lastrow).Copy Range("B3") 'firstnames
' ... etc.
.Range("$A$1:$CH$" & lastrow).AutoFilter
End With
Application.CutCopyMode = False
End If
Application.ScreenUpdating = True
End Sub
Bookmarks