LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Inputting criteria into a macro/vb code

I don't know if anyone can help. I need to create some code that operates
autofilter, I don't have a problem doing this:
Sub TEST()
Sheets("Store Data").Select
Selection.AutoFilter Field:=8, Criteria1:="10", Operator:=xlTop10Items
Selection.AutoFilter Field:=20, Criteria1:="30", Operator:=xlAnd
Selection.AutoFilter Field:=21, Criteria1:="50", Operator:=xlAnd
End Sub
However, the criteria and operator will change everytime, the user will be
putting the criteria and operator into cells on another sheet and I need the
code to pick up this data from the cells. Plus, there will sometimes be only
1, 2 or 3 critieria, ie, not all three selections will be made everytime.

Is this at all possible? Thanks in advance.

 
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
Inputting numbers using a macro. wazcaster Excel Discussion (Misc queries) 1 September 10th 07 11:38 AM
Deleting code from a macro (by a macro) Brettjg Excel Discussion (Misc queries) 2 May 8th 07 10:14 PM
Code help, delete rows based on column criteria Stout Excel Discussion (Misc queries) 2 March 20th 07 01:17 PM
inputting data Shanor Excel Discussion (Misc queries) 0 June 15th 06 10:50 AM
Problem with criteria when using it from VBA Code Alvaro Silva Excel Worksheet Functions 0 December 15th 05 12:25 AM


All times are GMT +1. The time now is 05:11 PM.

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

About Us

"It's about Microsoft Excel"