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!

Print excel columns based on a date in a cell

Status
Not open for further replies.

TenBellie

Technical User
Nov 20, 2012
22
GB
Hi,
I have a spreadsheet that has to columns of data in A and B, then moving accross there are columns for students attending a club i was wondering if there is a VBA code that would only print the data in Columns A & B and say Column AA if the date matches a day i could type into a cell so they are on the printed paper.

The only way i can do this at the moment is to keep hiding columns C, D, E etc then unhiding when there is a query.
 
Did you try to set the ActiveSheet.PageSetup.PrintArea property ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am not using print area - i have limited macro skills so manually hide and un-hide rows to print.

Column A contains names Column B contains class numbers - then thye sheet is filled in daily for each school day with who is attending a school club = i have to keep each day for quries of who has paid etc. Hiding and unhiding rows is the only way i can print the daily info required...

Sorry and really hoping someone can help me...
 
if there is a VBA code that would only print the data in Columns A & B and say Column AA
ActiveSheet.PageSetup.PrintArea = "$A:$B;$AA:$AA"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks but AA would only be for today, tomorrow it would be Ab, then Ac etc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top