Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It has to execute before you print.
Where you put it would be your call. You might want to consider the Beforeprint event. It assumes the unfilled cells in column B are actually empty and not prefilled with some conditional formula that makes the cell look empty, but isn't. -- Regards, Tom Ogilvy "SITCFanTN" wrote: Does this code have to be attached to a cmd button Tom? I'm wondering because I added it to my worksheet code and it is still printing two pages even if I only have text in 5 rows in cols B. FYI the reason I'm looking at text in Col B is because I have the sheet prefilling with row numbers in col A. Thanks again for your help. "Tom Ogilvy" wrote: ActiveSheet.PageSetup.PrintArea = _ "$A$1:$F$" & cells(rows.count,"B").End(xlup).row -- Regards, Tom Ogilvy "SITCFanTN" wrote: I have this code to print rows 1 - 35 however I would just like to print the rows that have data in col B because often I'm printing an empty page by printing all 35 rows. I would like the print area to print col A - F but only when there is text in Col B of that row, how would I code that. I appreciate your help and so do the trees :-) ActiveSheet.PageSetup.PrintArea = "$A$1:$F$35" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print has some blank rows but screen has data in rows | Excel Discussion (Misc queries) | |||
Print only rows with data entered in an excel template | Excel Discussion (Misc queries) | |||
Print data filled rows only | Excel Worksheet Functions | |||
do not print rows with zero data | Excel Discussion (Misc queries) | |||
Print single sheets from rows of data | Excel Programming |