ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Page Header to Include Variable Values (https://www.excelbanter.com/excel-programming/397086-page-header-include-variable-values.html)

GDCross

Page Header to Include Variable Values
 
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?

Tom Ogilvy

Page Header to Include Variable Values
 
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

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy


"GDCross" wrote:

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?



All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com