+ Reply to Thread
Results 1 to 3 of 3

[SOLVED] how to stop/ restart macro after selecting from autofilter list

  1. #1
    ronnie davidson
    Guest

    [SOLVED] how to stop/ restart macro after selecting from autofilter list

    How do I stop and restart macro after selecting item from an autofilter list

  2. #2
    Don Guillett
    Guest

    Re: how to stop/ restart macro after selecting from autofilter list

    As always post your coding efforts for comments

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "ronnie davidson" <ronnie [email protected]> wrote in
    message news:[email protected]...
    > How do I stop and restart macro after selecting item from an autofilter
    > list




  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi Ronnie,

    I agree with Don, it is much easier to offer suggestions when we can consider what you already have. However, in saying that, from what you have stated, I'd suggest incorporating the filtering action into the existing macro & entering the value using an input box eg:

    Dim StringToFind As String
    StringToFind = InputBox("Please enter your string to find", "String to Find")

    'To end sub if "cancel" was pressed sourced from _
    http://www.excelforum.com/showthread...vbcancel+input & http://vb.mvps.org/tips/varptr.asp
    If StrPtr(StringToFind) = 0 Then
    MsgBox "no string to find entered"
    GoTo ExitSub
    Else
    End If

    Range("a1", ActiveCell.SpecialCells(xlLastCell)).AutoFilter Field:=1, _
    Criteria1:="=*" & StringToFind & "*"

    Have a play with this & see if it works for you. To set the column for filtering, change "Field:=1," to another #. NB, 1 is not necessarily col A, it is the first column with a filter on it.
    If you would like a complete macro (which can be linked to a short cut key)that will do things like filter for contents of active cell/ blanks/ your input etc, let me know & I can post my toy!
    Or for something more bulletproof but potentially slower try searching for Ron DeBruin's EasyFilter addin.

    hth
    Rob Brockett
    NZ
    Always learning & the best way to learn is to experience...

+ 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