+ Reply to Thread
Results 1 to 2 of 2

Autofilter criteria not yet known

  1. #1
    JeffMelton
    Guest

    Autofilter criteria not yet known

    How can I use autofilter to run through the list of items? I'm getting
    data and column R is product ID. I would like to filter the first item
    in the list, run some code on it and then move to the next item until
    it has gone through the enitre list. I can't figure out how to do this
    though.

    Thanks in advance


  2. #2
    Harald Staff
    Guest

    Re: Autofilter criteria not yet known

    Hi

    Sub Filterem()
    Dim Itms As New Collection
    Dim R As Long
    On Error Resume Next
    For R = 2 To Cells(65000, 18).End(xlUp).Row
    Itms.Add Cells(R, 18).Value, Cells(R, 18).Value
    Next
    On Error GoTo 0
    For R = 1 To Itms.Count
    Range("R2").CurrentRegion.AutoFilter Field:=1, Criteria1:=Itms(R)
    MsgBox Itms(R), , R & " of " & Itms.Count
    Next
    End Sub

    HTH. Best wishes Harald

    "JeffMelton" <[email protected]> skrev i melding
    news:[email protected]...
    > How can I use autofilter to run through the list of items? I'm getting
    > data and column R is product ID. I would like to filter the first item
    > in the list, run some code on it and then move to the next item until
    > it has gone through the enitre list. I can't figure out how to do this
    > though.
    >
    > Thanks in advance
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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