View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Passing a Variable to a Macro

Iam,

It is easy:

ActiveSheet.Range("$A$5:$CW$355").AutoFilter Field:=77,
Criteria1:=InputBox("Criteria?")

HTH,
Bernie
MS Excel MVP


"IAM" wrote in message
...
I want to create a simple Macro that sorts a list by the criteria that a
user
enters. I know I would hard code this macro with something liek:
ActiveSheet.Range("$A$5:$CW$355").AutoFilter Field:=77, Criteria1:="0008"

but I want the user to be prompted to select the Criteria, "0008" in this
instance, and then have the list sort.

I am hoping it is pretty easy...

Thanks