Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

checkup2012a

Technical User
Oct 19, 2012
1
CA
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
 
Thz macro recorder is your friend.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I agree with PHV. As an added thought, when recording, sort so that blanks are on the bottom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top