Thread: Set print area
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Porky79 Porky79 is offline
external usenet poster
 
Posts: 19
Default Set print area

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