+ Reply to Thread
Results 1 to 2 of 2

worksheet change event - filter issue

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,233

    worksheet change event - filter issue

    hello all



    i have the following macro that filters data on worksheet change event



    the issue is....i would like for it to filter row 13...my name is "_Data"


    
        If Target.Address = "$U$7" Then
            Application.ScreenUpdating = False
        
        With Range("_Data")
            .AutoFilter
            For c = 1 To .Columns.Count
                .AutoFilter field:=c, visibledropdown:=False
            Next c
            .AutoFilter field:=19, Criteria1:=Range("MPLink").Value
        End With
        
        Range("Header") = "Filtered by: M/P"
        Application.ScreenUpdating = False
    End If


    however, my name ranged "_DATA" starts at row 14...therefore when i filter, it does not filter row 13....i dont want to change my defined name as it links to alot of other sheets....is there in the macro after "_DATA" where i can make the macro go up one row from _Data?



    pls help!!!!
    Last edited by jw01; 04-05-2012 at 09:24 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: worksheet change event - filter issue

    Try this -
    With Range("_Data")
            .offset(-1,0).AutoFilter
            For c = 1 To .Columns.Count
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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