LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default autofilter macro

In a sheet I have two text boxes and a search button
when the user inputs some value into the text boxes and clicks the search

I want the data to be filtered....
I have started to write a macro and got stuck

any help ?

Private Sub Image1_Click()
Dim s As String
Dim p As String
s = TextBox1.Value
p = TextBox2.Value

Selection.AutoFilter Field:=5, Criteria1:="=5", Operator:=xlAnd,
Criteria2:="<=400"
end sub

Also in case of error.. like if the user doesnt type value in the boxes?
what codes goes ?I
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Keep autofilter after macro is run gmr7 Excel Worksheet Functions 2 July 5th 05 01:16 PM
Loop Macro autofilter Paul. Excel Discussion (Misc queries) 2 March 25th 05 09:35 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 07:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"