Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Using Filters in Macros

I am recording a macro which copies a cell and then pastes it as a criteria
for an autofilter. However, the macro records the exact name of the cell
value I have pasted. I would like the macro to copy and paste whatever is in
that cell, not the exact name. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Using Filters in Macros

Let me see if I understand your problem? You recorded a macro and maybe the
code in it looks like this:
Range("F5").Select
Selection.Copy
Range("C3").Select
ActiveSheet.Paste

So every time it runs you are always copying the contents of cell F5 to C3,
but you need to copy what is in the current cell you have selected to use.
If that's the case, just delete that first line of code
Range("F5").Select
from the code, then it will take what ever cell is currently selected and
use it to perform the paste into cell C3.

To modify the code, use
Tools | Macro | Macros and then choose the name of the macro in question and
click the [Edit] button, make your changes and close the VB Editor.

Hope this helps.

"Plum" wrote:

I am recording a macro which copies a cell and then pastes it as a criteria
for an autofilter. However, the macro records the exact name of the cell
value I have pasted. I would like the macro to copy and paste whatever is in
that cell, not the exact name. Any ideas?

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
Using Filters in Macros TMC Excel Discussion (Misc queries) 0 November 30th 06 04:09 AM
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
Suggested new functionalities for Filters, Pivots and other issues ed05h Excel Discussion (Misc queries) 0 April 30th 06 04:00 PM
Suggested new functionalities for Filters, Pivots and other issues ed05h Excel Discussion (Misc queries) 0 April 24th 06 10:01 PM
how do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM


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