LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Can't insert a String Variable of Long Date into Page Header

D'oh!

Thank you (and Dick) for the prompt reply...

It worked. Next, I'll get new glasses... :)

"sebastienm" wrote:

Hi,
You forgot to close the second font definition with a double-quote. It
should be:
"&""Arial,Bold""&12Employee Roster" & Chr(10) & "&""Arial,Regular""" & TheDate
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Ronny Hamida" wrote:

I think this might be an easy one...

I have this code in my main Workbook to retrieve the date from cell C17 and
keep it as a String Variable called TheDate:

Dim TheDate As String

If Range("C17").Value = "" Then
Range("C17").Select
MissingDate = MsgBox("Please input the date into the date box.",
vbOKOnly, "Missing Date")
End
Else
TheDate = Format(Range("C17").Value, "mmmm d, yyyy")
End If

I have then checked the variable, TheDate, to make sure that it retained the
information as needed. For instance, if someone enters 4/3/2006 into cell
C17, TheDate is then equal to "April 3, 2006".

When I try to put this into my page header, all I get is the "2006" from
this variable. Here's a sample of what I have to populate my page header:


With ActiveSheet.PageSetup
.CenterHeader = _
"&""Arial,Bold""&12Employee Roster" & Chr(10) & "&""Arial,Regular" &
TheDate
End With

If the string variable, TheDate, is equal to "April 3, 2006" then why do I
only get "2006" in the header where the full value should be?

I have even tried to change the variable type to Date (Dim TheDate as Date)
and work with it that way, but it just disappears.

Any thoughts?

Thank you!

 
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 insert Header will full text across page Janet A. Thompson Excel Discussion (Misc queries) 0 January 12th 10 02:14 PM
How can I include a variable in an Excel page header omstefanov Excel Discussion (Misc queries) 0 January 10th 07 07:41 PM
search for date in long string of text ryan00davis Excel Discussion (Misc queries) 4 August 11th 06 07:06 PM
How do I use long date format in a header or footer? Long Date Format in Excel Excel Discussion (Misc queries) 1 November 17th 05 01:23 AM
Get long value for a date string jerry chapman[_2_] Excel Programming 4 February 22nd 05 11:06 PM


All times are GMT +1. The time now is 10:54 AM.

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"