Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default adding cell data into a macro to allow specified information filte


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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default adding cell data into a macro to allow specified information filte

Using Autofilter?

instead of Criteria1:="ABC"

put in

Criteria1:=Worksheets(1).Range("E9").Value

--
Regards,
Tom Ogilvy


"mattguerilla" wrote in message
...

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?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default adding cell data into a macro to allow specified information f

thankyou very much lads...excellent

Matt
Reply
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
How to get a copy of the first row Text value displayed in a filte icsonu Excel Discussion (Misc queries) 0 August 20th 08 09:07 PM
Allow users of protected sheet to use macro involving custom filte Roady Excel Discussion (Misc queries) 3 June 17th 08 04:41 PM
Adding Data Information to a Chart Mike M Charts and Charting in Excel 4 December 17th 05 12:12 AM
Duplicate Data -Adding information to another column in row & dele Jacky D. Excel Discussion (Misc queries) 3 July 27th 05 01:00 AM
Macro to move information to different cell lazyluci Excel Programming 2 June 11th 04 03:17 PM


All times are GMT +1. The time now is 10:48 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"