View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default adding cell data into a macro to allow specified information filte

One way:


Sheets("Sheet1").Range("A1").AutoFilter _
Field:=1, _
Criteria1:=Sheets("Sheet1").Range("J10").Value, _
VisibleDropDown:=True



Or, more efficiently:

With Sheets("Sheet1")
.Range("A1").AutoFilter, _
Field:=1, _
Criteria1:=.Range("J10").Value, _
VisibleDropDown:=True
End With





In article ,
mattguerilla wrote:

I have a macro which filters information in a worksheet and then copies
certain columns of the filtered data to another worksheet. The macro that
does this already contains the filter criteria. What I would like to do is
allow a user to type information into a given cell which the macro will read
and use as the filter criteria (when the macro runs). Can this be done?