Results 1 to 2 of 2

Thread: Autofiltering Macro using named ranges in Workbook
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Mar 2018
    Posts
    6
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Autofiltering Macro using named ranges in Workbook

    Hi everyone
    I have a workbook where each week, I recreate the file and assign a quarter, year and fiscal week. My named ranges are as follows, all on my SETUP tab within the workbook


    B2 = CFW = Current Fiscal Week = FW23
    B3 = PFW = Prior Fiscal Week = FW21
    B4 = PQTR = Pacing Quarter = ex. Q2
    B5 = PYR = Pacing Year = 2018

    I am trying to write a macro to autofilter my base data based on the PQTR, which is all in a data table called Template.

    Code:
    ActiveSheet.ListObjects("Template").Range.AutoFilter Field:=3, Criteria1:= _
            Sheets(Setup).Range("B4").value
    I am getting an error with this. Any suggestions? Thanks!

  2. #2
    Board Regular
    Join Date
    Jun 2002
    Location
    Abergavenny, Wales, UK
    Posts
    259
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Autofiltering Macro using named ranges in Workbook

    You haven't said what the error message is.
    Does B4 on Sheet Setup contain Q2?
    Does Q2 exists in any cell within the third column of the table Template?
    --
    Roger Govier
    Technology 4 U

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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