+ Reply to Thread
Results 1 to 2 of 2

AutoFilter macro with dynamic criteria

  1. #1
    Registered User
    Join Date
    12-09-2008
    Location
    Colombia
    Posts
    1

    Thumbs up AutoFilter macro with dynamic criteria

    Hello

    I noticed thet here ppl get a lotta help with VBA and excel issues. I hope you guys can help me too

    Heres my problem (Im using Excel 2007)

    Im using a cell value as a filter criteria in another sheet.

    Heres my schema:

    Sheet1: Data (col1, col2, col3...col10)
    Sheet2: Control Values (control_col1, control_col2, control_col3....control_col7)

    What I do is runing a macro that AutoFilter data in Sheet1, according to the actual value for the column. For example, I filter the data with col7 = sheet2.control_col7 (col7 is a date value), delete the records that match this criteria, and then replace the control_col3 value with the next date.
    The idea of the macro is to delete the history of certain data, and update the control_col7 for the next time the macro runs.

    The macro works fine the 1st time, but the 2nd time, something happens to the criteria.... i doestn filter correctly... i have to enter manually to the field, and re-apply the filter (without changing the criteria) and then it filters correctly.

    Heres the code I'm using


    Please Login or Register  to view this content.
    here is where I assign the criteria value

    Please Login or Register  to view this content.


    Hope anyone can help me...
    Last edited by juuck; 12-09-2008 at 02:47 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    Maybe attach a sample workbook showing the desired results as well, save it as a pre-2007 format.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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