Page Header to Include Variable Values

G

GDCross

I am working on a macro to create a PivotChart and need this chart to include
some data in the page header. This information pertains to the charting date
range and production goal. The variables are Goal, StartDate, and EndDate and
my current code is as follows:

..LeftHeader = "Date Range: ???" & Chr(10) & "Goal: ???"

Any guidance in terms of how I would represent these variables in this code?
 
T

Tom Ogilvy

If StartDate and EndDate contain real date serial numbers:

..LeftHeader = "Date Range: " & format(StartDate,"mm/dd/yyyy") & " to " &
Format(EndDate,"mm/dd/yyyy") & Chr(10) & "Goal: " & Goal

If they are just strings like 3/10/07 then

..LeftHeader = "Date Range: " & StartDate & " to " & EndDate & Chr(10) &
"Goal: " & Goal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top