Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It appears that in Excel XP, the ".LeftHeader " line is just skipped (with
no error for me either) when it encounters a run time error ( ..Range("A1:B1").Text ). Don't know about earlier version though. Sub CellInHeader() With ActiveSheet.PageSetup .LeftHeader = [A1] & Space(1) & [B1] '...etc End With End Sub -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "Tom Ogilvy" wrote in message ... .Range("A1:B2").Text gives an error .Range("A1").Text & " " & .Range("B1").Text maybe what you meant. -- Regards, Tom Ogilvy Gord Dibben wrote in message ... Sandy Sub CellInHeader() With ActiveSheet .PageSetup.LeftHeader = .Range("A1:B1").Text End With End Sub You could also place this code as a BeforePrint in the Thisworkbook module. Private Sub Workbook_BeforePrint(Cancel As Boolean) With ActiveSheet .PageSetup.LeftHeader = .Range("A1:B1").Text End With End Sub Gord Dibben Excel MVP XL2002 On Sun, 17 Aug 2003 13:11:12 -0700, "Sandy" wrote: I would like to put the contents of A1 and B1 into the header. A1 and B1 are not names of columns. Is there a way to do this? I came up with zip when searching Help. Sandy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
what code pulls in contents of a cell in an Excel header/footer? | Excel Discussion (Misc queries) | |||
Omit header from first page without embedding header in code | Excel Worksheet Functions | |||
Cell contents in header/footer | Excel Worksheet Functions | |||
Display cell contents in the Header or Footer? | Excel Discussion (Misc queries) | |||
Insert cell contents into header/footer | Excel Discussion (Misc queries) |