Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Search range

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Isle of Man
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I've made a macro so that when I enter a number in a textbox1 and textbox2 it finds all of the values between them (say 1 to 15)
    but i cant seem to get the macro to work, could someone please assist me on this please, thankyou.
    heres the macro i have so far

    Sub Search_sale1(X As String)

    Selection.AutoFilter Field:=3, Criteria1:=">X", Operator:=xlAnd

    End Sub

    Sub Search_sale2(y As String)

    Selection.AutoFilter Field:=3, Criteria1:=" End Sub

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hope this helps you...

    Where TextBox1.Text = "1"
    and TextBox1.Text = "15"



    Sub SearchSale(FromNum As String, ToNum As String)
    Columns("A").AutoFilter Field:=3, Criteria1:=">=" & FromNum, Operator:=xlAnd, _
    Criteria2:="<=" & ToNum
    End Sub




    Tom

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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