+ Reply to Thread
Results 1 to 3 of 3

How to write VBA code to filter a field when opening a workbook?

  1. #1
    Registered User
    Join Date
    04-27-2012
    Location
    Logoo
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question How to write VBA code to filter a field when opening a workbook?

    Hi,

    I want to write VBA code to filter a field (within a sheet) when opening a workbook.

    For example, I have a workbook [alldata.xlsx]. Within this workbook, there is a sheet "Template" with the following fields:
    ID ~~~~ Name ~~~~ Year ~~~~ Quarter ~~~~ Sales
    .....................................
    .....................................
    .....................................

    When I open the workbook [alldata.xlsx], the table in the sheet "Template" would filter the field ID with a criterion excluding blank values.

    How to write the VBA code?


    Thank you in advance
    Last edited by checkup2012; 10-19-2012 at 03:19 PM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: How to write VBA code to filter a field when opening a workbook?

    supposing you have nothing else on this tab "DATA" you can use this macro:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    04-27-2012
    Location
    Logoo
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to write VBA code to filter a field when opening a workbook?

    Thank you Pierre.

+ 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