Set print area

P

Porky79

Hi guys,

I am successfully using the following macro to define and set print
area based on the presence of a column header in row A.

Range("A1:Z52").Select
ActiveSheet.PageSetup.PrintArea = "A1:OFFSET(A1,51,COUNTA
(A1:Z1)-1)"

I have now set a formula in row A for each column that will leave the
cell blank if not data is entered into a specified cell (formula used:
=IF(T2,T2,"")).

However the macro I am running to set print area obviously works on
counting blank cells and the fact that the cell contains a formula
(albeit noting is displayed) is not classed as blank.

Can anyone suggest an alternative PrintArea macro that will set print
area so that only columns with a header displayed in row A will be
printed?

Any help much appreciated (as always)

Best wishes

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Set Print Area 1
Set Print Area Macro 1
Setting Print Area 1
Setting Print Area (Macro Question) 1
PrintArea Macro Help 1
Set Print Area with Dynamic Start Point 2
Print Area Range Selection 2
Set Print Area 4

Top