View Single Post
  #3   Report Post  
Pank
 
Posts: n/a
Default

Paul,

I have the following code but it only prints the date (in the format I want).

Private Sub Workbook_BeforePrint(Cancel As Boolean)
mystring = Format(Range("M5").Value, "dd/mm/yyyy")
mytstring2 = Range("L5").Value
myfooter = mystring & " " & mystring2
Me.Unprotect
ActiveSheet.PageSetup.LeftFooter = myfooter
Me.Protect
End Sub

Any more suggestions?

Pank

"paul" wrote:

this worked for me to "concatenate" two cells with a space in the middle

mystring = Range("M5").Value
mytstring2 = Range("L5").Value
myfooter = mystring & " " & mystring2
--
paul
remove nospam for email addy!



"Pank" wrote:

I want to insert the contents of 2 cells (L5 and M5) into a footer.

I am using the following: -

ActiveSheet.PageSetup.LeftFooter = Range("M5").Value

When, I change the Range command to read Range("M5,L5").Value, I just get
the contents for cell L5 printed (which by the way is a date that has been
formatted to dd/mm/yyyy).

When, I change the Range command to read Range("M5:L5").Value, I just get
the contents for cell M5 printed (which by the way is text).

When, I change the Range command to read Range("M5", "L5").Value, I just get
the contents for cell M5 printed (which by the way is text).

I also defined cells L5 and M5 as a named range (For_Week). When, I change
the Range command to read Range("For_Week€ť).Value, I just get the contents
for cell M5 printed (which by the way is text).

I have had a look at the print preview and in the Left Footer I can see the
Text €śFOR WEEK€ť but nothing after it.

Can you please help to solve my problem?