Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default page header multiple rows

Good afternoon Group,

Trying to make something like the below to work. Not sure if it even is
possible.
Grateful for some hints.

Brgds

CG Rosén
----------------------------------------
From a column, text is loaded into str as below. The number of cells that
contains text
my vary from 1 to 10.

Dim str As Variant
str = Array(0, 1, 2, 3, 4, 5, 6, 7 ,8, 9)

For j = 1 To 10
str(j - 1) = Cells(j, 1)
Next j

if str() < "" I would like to transfer the string to the
page header as lines with line feed. Cant figure out of to get the string
into the Setup.

With Sheets("Sheet1").PageSetup
.LeftHeader = "&8" & str(0) & Chr(10) & str(1) & Chr(10) &
str(2).......................................etc
End With



  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default page header multiple rows

You could try:

Sub test()
Dim varTemp As Variant
Dim strTemp As String

varTemp = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

For j = LBound(varTemp) To UBound(varTemp)
If Len(varTemp(j)) 0 Then
strTemp = strTemp & varTemp(j) & Chr(10)
End If
Next j

If Len(strTemp) 0 Then
strTemp = Left$(strTemp, Len(strTemp) - 1)
Sheets("Sheet1").PageSetup.LeftHeader = "&8 " & strTemp
End If
End Sub


Note that there is a space here "&8 ". This is to separate the font size
(8) from your header and to keep XL from thinking the font size s/b 80 (since
your header string begins with a 0). Alternatively, you could use a line
break

"&8" & Chr(10) & strTemp



"CG Rosén" wrote:

Good afternoon Group,

Trying to make something like the below to work. Not sure if it even is
possible.
Grateful for some hints.

Brgds

CG Rosén
----------------------------------------
From a column, text is loaded into str as below. The number of cells that
contains text
my vary from 1 to 10.

Dim str As Variant
str = Array(0, 1, 2, 3, 4, 5, 6, 7 ,8, 9)

For j = 1 To 10
str(j - 1) = Cells(j, 1)
Next j

if str() < "" I would like to transfer the string to the
page header as lines with line feed. Cant figure out of to get the string
into the Setup.

With Sheets("Sheet1").PageSetup
.LeftHeader = "&8" & str(0) & Chr(10) & str(1) & Chr(10) &
str(2).......................................etc
End With




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort when I have multiple header rows (not included in sor. K_Millan Excel Discussion (Misc queries) 1 February 24th 10 08:25 PM
Excel Table into Word with header rows on top of each page AndrewL Excel Discussion (Misc queries) 0 October 5th 09 09:10 PM
How to repeat multiple rows as a header - each page of worksheet? laurandc Excel Worksheet Functions 1 August 17th 06 03:03 PM
I need multiple header rows PaoloScaglioni Excel Discussion (Misc queries) 5 June 2nd 06 07:27 PM
Sort with multiple header rows Suzy Greblo Excel Discussion (Misc queries) 3 June 6th 05 10:50 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"