ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Changing all Dates on Headers (https://www.excelbanter.com/excel-worksheet-functions/155174-changing-all-dates-headers.html)

Matt Dollar

Changing all Dates on Headers
 
I have a workbook that I use monthly to Outline clients into different
regions. An example of one of the Headers is "August 10, 2007 - Ameritech
Business". My Problem is that the work book has 100+ tabs. Changing the
dates manually takes time that I now do not have. I searched and tried a few
trial and error codes but could not work it out. I would prefer to manually
run the code versus the dates being changed every print or every time the
workbook is opened.

I am also in need a diffrent code that would change the dates on Invidual
tabs. An example of one of the tabs is " Location Summary Dtl Aug 2007"
where the only change needed would be Aug to Sep.

I know I'm greedy!

Thanks for your help!

Gary''s Student

Changing all Dates on Headers
 
Running this will change all the dates in the Center header to today's date:

Sub adjustit()
For Each sh In Worksheets
sh.Activate
v = ActiveSheet.PageSetup.CenterHeader
s = Format(Date, "mmmm dd, yyyy") & " - " & Split(v, "-")(1)
ActiveSheet.PageSetup.CenterHeader = s
Next
End Sub

--
Gary''s Student - gsnu200738


"Matt Dollar" wrote:

I have a workbook that I use monthly to Outline clients into different
regions. An example of one of the Headers is "August 10, 2007 - Ameritech
Business". My Problem is that the work book has 100+ tabs. Changing the
dates manually takes time that I now do not have. I searched and tried a few
trial and error codes but could not work it out. I would prefer to manually
run the code versus the dates being changed every print or every time the
workbook is opened.

I am also in need a diffrent code that would change the dates on Invidual
tabs. An example of one of the tabs is " Location Summary Dtl Aug 2007"
where the only change needed would be Aug to Sep.

I know I'm greedy!

Thanks for your help!


Matt Dollar[_2_]

Changing all Dates on Headers
 
My bad.. forgot to mention I need to change the date monthly. Thus August
10, 2007 would need to change to September 10, 2007.


Thanks for your help though Gary"s Student

"Matt Dollar" wrote:

I have a workbook that I use monthly to Outline clients into different
regions. An example of one of the Headers is "August 10, 2007 - Ameritech
Business". My Problem is that the work book has 100+ tabs. Changing the
dates manually takes time that I now do not have. I searched and tried a few
trial and error codes but could not work it out. I would prefer to manually
run the code versus the dates being changed every print or every time the
workbook is opened.

I am also in need a diffrent code that would change the dates on Invidual
tabs. An example of one of the tabs is " Location Summary Dtl Aug 2007"
where the only change needed would be Aug to Sep.

I know I'm greedy!

Thanks for your help!


Gary''s Student

Changing all Dates on Headers
 
So run the macro on the 10th of each month and all will be well.


OR


Sub adjustit()
For Each sh In Worksheets
sh.Activate
v = ActiveSheet.PageSetup.CenterHeader
s = Format(Date, "mmmm 10, yyyy") & " - " & Split(v, "-")(1)
ActiveSheet.PageSetup.CenterHeader = s
Next
End Sub

run the above anytime and the Headers will go to the 10th of the current
month!!
--
Gary''s Student - gsnu200738


"Matt Dollar" wrote:

My bad.. forgot to mention I need to change the date monthly. Thus August
10, 2007 would need to change to September 10, 2007.


Thanks for your help though Gary"s Student

"Matt Dollar" wrote:

I have a workbook that I use monthly to Outline clients into different
regions. An example of one of the Headers is "August 10, 2007 - Ameritech
Business". My Problem is that the work book has 100+ tabs. Changing the
dates manually takes time that I now do not have. I searched and tried a few
trial and error codes but could not work it out. I would prefer to manually
run the code versus the dates being changed every print or every time the
workbook is opened.

I am also in need a diffrent code that would change the dates on Invidual
tabs. An example of one of the tabs is " Location Summary Dtl Aug 2007"
where the only change needed would be Aug to Sep.

I know I'm greedy!

Thanks for your help!


Matt Dollar[_2_]

Changing all Dates on Headers
 
My issue is that the report is due on the last day of the previous month.
Ie. September 10th report is due August 31st. This sort of does what I need
it to do except it changes the font. I need the font to be Times New Roman
Bold Size 14.

Once Again Thanks for your Help!
Any Ideas on changing tab dates?

M$

"Gary''s Student" wrote:

So run the macro on the 10th of each month and all will be well.


OR


Sub adjustit()
For Each sh In Worksheets
sh.Activate
v = ActiveSheet.PageSetup.CenterHeader
s = Format(Date, "mmmm 10, yyyy") & " - " & Split(v, "-")(1)
ActiveSheet.PageSetup.CenterHeader = s
Next
End Sub

run the above anytime and the Headers will go to the 10th of the current
month!!
--
Gary''s Student - gsnu200738


"Matt Dollar" wrote:

My bad.. forgot to mention I need to change the date monthly. Thus August
10, 2007 would need to change to September 10, 2007.


Thanks for your help though Gary"s Student

"Matt Dollar" wrote:

I have a workbook that I use monthly to Outline clients into different
regions. An example of one of the Headers is "August 10, 2007 - Ameritech
Business". My Problem is that the work book has 100+ tabs. Changing the
dates manually takes time that I now do not have. I searched and tried a few
trial and error codes but could not work it out. I would prefer to manually
run the code versus the dates being changed every print or every time the
workbook is opened.

I am also in need a diffrent code that would change the dates on Invidual
tabs. An example of one of the tabs is " Location Summary Dtl Aug 2007"
where the only change needed would be Aug to Sep.

I know I'm greedy!

Thanks for your help!



All times are GMT +1. The time now is 04:03 AM.

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