View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
dilettante dilettante is offline
external usenet poster
 
Posts: 25
Default Insert cellS(!) text into header for printing

Nigel,
now I have it: it works perfectly.
Thank you!
Regards
--
dilettante


"dilettante" wrote:

Hello,
Thank you for helping.
The first lkisting works well.
The second one (which is more useful then the first) have a Run Time Error 9
coming out when the procedure reaches the expression
".PageSetup.LeftHeader = Sheets("Sheet1").Range("A1").Text ".
I will try to understand the reason why.
Best regards

--
dilettante


"dilettante" wrote:

Hello
I copied the basic listing and tryed to have it working for all the headers
but it works only for the first one. What do I wrong?
Thank you for helping

Sub InsertCellsDataInHeader()

With ActiveSheet
.PageSetup.LeftHeader = .Range("A1").Text
.PageSetup.CenterHeader = .Range("A2").Text
.PageSetup.RightHeader = .Range("A3").Text
End With

End Sub

--
dilettante