+ Reply to Thread
Results 1 to 3 of 3

Macro that will adjust Auto Filter variables

  1. #1
    Registered User
    Join Date
    05-09-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Macro that will adjust Auto Filter variables

    I'm trying to figure out how to adjust a macro that I use with the Auto-Filter tool so that I can have the auto-filter look for an adjustible variable (cell reference) rather than a fixed value imbedded in the macro. I simply recorded the below macro. Instead I want the macro to set the auto-filter value (field 26 in this case) to a value listed on a different sheet (i.e. the variables are my employee names). The sheet name with the employee list is called "Associate List" and I've also defined the range and called it "name_list" in case that helps. I'm not sure how to reference this within my macro - I've tried and failed lots of times today.

    Note: My goal is to repeat this macro (copy and paste it) multiple times, but each new cycle will set the auto-filter in field 26 with the next variable on the Associate List sheet. There will be some additional code in between that I'll use to copy and paste the results into a new sheet but I've got that figured out. Thanks for any help!

    Please Login or Register  to view this content.

    Here's the full macro code that I have so far...It's the first part that I'm having trouble adjusting. FYI, the rest of the code simply copies the data to a new sheet (work in progress).

    Please Login or Register  to view this content.
    Last edited by gjohn282; 03-05-2012 at 06:41 PM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Macro that will adjust Auto Filter variables

    try using:

    Please Login or Register  to view this content.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    05-09-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro that will adjust Auto Filter variables

    Thank you! That worked perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1