View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default setting print area

Hi Nick,

Try:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim rng As Range
Dim LRow As Long

Set SH = ActiveSheet '<<==== CHANGE

With SH
LRow = SH.Cells(Rows.Count, "A").End(xlUp).Row
Set rng = .Range("A15:A" & LRow)
.PageSetup.PrintArea = rng.Address
End With

End Sub
'<<=============


---
Regards,
Norman


"Nick Smith" wrote in message
...
Hi,

Can anyone help me with a macro to search down column A from row 15
onwards
(inclusive) until it finds the last cell containing any text (cell #), and
then set the print area to cells A1:X#, where # is the last cell in column
A
containing any text?

Any help with this would be much appreciated!

Thanks in advance,

Nick