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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Autofilter Results in Excel 1

Status
Not open for further replies.

rjm65

Technical User
May 27, 2003
86
US
I have 4 columns, A is quantity, B is part#, C is description, D is cost, E is my extended cost and all together about a thousand rows worth of product information. The user inputs a number in column A. I then run the following so that only those rows with a qty appear:

ActiveSheet.Unprotect Password:="my password"
With Range("A9")
.AutoFilter
.AutoFilter Field:=1, Criteria1:="<>"
ActiveSheet.PageSetup.PrintArea = "$A:$E"
ActiveSheet.Protect Password:="my password"
End With
End Sub

This makes it easier to print out a list of only those items that need to be ordered. I would like to automatically format the results of the autofilter with a border around each cell so that they are easier to read. If I add a border to all my cells (A9:E1012), then all 15+ pages print out even after I autofilter. So I believe the border must be added after the autofilter been run. Is it possible to do that with VBA?

I'm really just stumbling my way around VBA here, so any new guy tips on how I may solve this would be greatly appreciated.

Thanks in advance,
Raymond
 
Doesn't this suffice ?
ActiveSheet.PageSetup.PrintGridlines = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Works like a charm PH!! Thank you!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top