New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Header & Footer Help

Macros, VBA, Excel Automation, etc.

Header & Footer Help

Postby danieldriftwood » Thu Jan 05, 2012 6:58 pm

I'm a novice-intermediate level Excel user. I use Excel for scheduling employees. Each week, a new workbook is created with the weekly schedule. Each week, I change the Footer of Worksheet1 to reflect the new info, for example "Office Schedule 01/29/12 - 02/04/12." That Footer of Worksheet1 should also be the Header of Worksheet2 and Worksheet3. When I change the Footer of Worksheet1 for the next week's schedule, I want the Headers of Worksheet2 and Worksheet3 to change to match the Footer of Worksheet1 using some sort of macro.

Please let me know if this is possible and I appreciate any assistance.

Thanks,

Dan D.
  • 0

danieldriftwood
Rookie
 
Posts: 2
Joined: Jan 5, 2012
Reputation: 0

Re: Header & Footer Help

Postby Sisyphus » Fri Jan 06, 2012 6:21 am

Hi,
I had the wrong idea and posted it only to find out that it didn't work. In case you saw it before I deleted, it was borrowed from MS Word but can't be realized in Excel. :oops:
Embarrassed as I was I decided to really help. So, a real solution - working and tested - is attached. :D
Enjoy your day!
  • 0

You do not have the required permissions to view the files attached to this post.
Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010

Re: Header & Footer Help

Postby danieldriftwood » Fri Jan 06, 2012 8:54 pm

Wow That's fantastic. I was able to tweak it a little to get it to match the wording I wanted, too! Thanks so much for the quick help.

Do you know how to make the date show as 02/09/12 as opposed to 02/09/2012? That would be the last thing I need to modify. Thanks again so much.

Dan D.
  • 0

danieldriftwood
Rookie
 
Posts: 2
Joined: Jan 5, 2012
Reputation: 0

Re: Header & Footer Help

Postby Sisyphus » Fri Jan 06, 2012 10:17 pm

Hi,
In the code the date is formatted as "Short date". I did this because I use dd.mm on my system and couldn't get Excel to show the month first. But you can try and replace the "Short date" in the Format() function with a mask like "mm/dd/yy" , like this:-
Code: Select all
Format(Mon, "mm/dd/yy")

Perhaps, on your system it will work as expected.

In Excel the date format is controlled by the Date and Time Settings in the Control Panel. That is where the "Short Date" is defined (as well as the Long Date). If you want a mm/dd/yy format for Short Date you can set it there but it will be applied globally. So, if you have a reason for having your Short Date set as mm/dd/yyyy in the Control Panel the above suggestion may enable you to eat your pudding and have it. :D
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 221 guests