Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Prompt for Header

Status
Not open for further replies.

jrobin5881

Technical User
Mar 10, 2004
228
0
0
US
Is there a VBA command for inserting the date into the header? I envision something like my user opens the Excel file and a input box would open prompting for the date. I store that in a variable that would update the header section in the worksheet.
 
Have you tried the macrorecorder ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I did that first "Path of least resistance" - but I need to store the user input in a variable so that I can prompt for a response each time the workbook opens.
 
Take a look at the InputBox function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Sorry, should be more explicit in my problem. I know how the inputbox works and I use that info to paste into specific cells. Example Sheet2.Cells(23, 1) = Dateinput. What I need is to put the user response into the header. so would it be Header.Cells = Dateinput ???
 
So, again, have you tried the macrorecorder for the header stuff ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The macro recorder will give you something like

Code:
 With ActiveSheet.PageSetup
        .PrintTitleRows = "$1:$1"
        .PrintTitleColumns = ""
        .PrintArea = ""
        .LeftHeader = "blah blah"
        .CenterHeader = "blah blah"
        .RightHeader = "blah blah"
        .LeftFooter = "&F"
        .CenterFooter = "Page &P of &N"
        .RightFooter = "&T"
etc etc etc

You will want to change the "blah blah" to sDateInput or whatever your variable is.


Code:
e.g.
        .CenterHeader = sDateInput
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top