Results 1 to 2 of 2

Filtering a list of Names from Worksheet1 onto Worksheet 2 based on specific criteria

Threaded View

  1. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,862

    Re: Filtering a list of Names from Worksheet1 onto Worksheet 2 based on specific criteria

    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
    Attached Files Attached Files
    Best Regards,

    Kaper

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Creating a list of worksheet names on a Summary PAge
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-06-2005, 06:05 PM
  2. Creating a list of worksheet names on a Summary PAge
    By confusedexceler in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  3. [SOLVED] Creating a list of worksheet names on a Summary PAge
    By confusedexceler in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. Creating a list of worksheet names on a Summary PAge
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] Creating a list of worksheet names on a Summary PAge
    By confusedexceler in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1