Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a excel workbook with 15 worksheets and every month when I produce the
annualized turnover I have to go into each header on each sheet to update the month. Do you know of a way using VB or a DATE FUNCTION I can automate the template to have the current month in the header? For example: Turnover October 2008 Best, Rachel |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Rachel,
Would this suits your needs? Sub AddMonth() For i = 1 To Sheets.Count Sheets(i).Select Range("A1").Formula = "=today()+30" Range("A1").Value = Range("A1").Value Range("A1").NumberFormat = "mmmm yyyy" Range("A1").Select 'Not necessary, but you might like it... Next i Sheets(1).Select 'Not necessary, but again, you may find it useful End Sub Regards, Feelu "Rachel Costanza" wrote: I have a excel workbook with 15 worksheets and every month when I produce the annualized turnover I have to go into each header on each sheet to update the month. Do you know of a way using VB or a DATE FUNCTION I can automate the template to have the current month in the header? For example: Turnover October 2008 Best, Rachel |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Of course I meant
Sub AddMonth() For i = 1 To Sheets.Count Sheets(i).Select Range("A1").Formula = "=today()" Range("A1").Value = Range("A1").Value Range("A1").NumberFormat = "mmmm yyyy" Range("A1").Select 'Not necessary, but you might like it... Next i Sheets(1).Select 'Not necessary, but again, you may find it useful End Sub Sorry for carelessness... "FiluDlidu" wrote: Hi Rachel, Would this suits your needs? Sub AddMonth() For i = 1 To Sheets.Count Sheets(i).Select Range("A1").Formula = "=today()+30" Range("A1").Value = Range("A1").Value Range("A1").NumberFormat = "mmmm yyyy" Range("A1").Select 'Not necessary, but you might like it... Next i Sheets(1).Select 'Not necessary, but again, you may find it useful End Sub Regards, Feelu "Rachel Costanza" wrote: I have a excel workbook with 15 worksheets and every month when I produce the annualized turnover I have to go into each header on each sheet to update the month. Do you know of a way using VB or a DATE FUNCTION I can automate the template to have the current month in the header? For example: Turnover October 2008 Best, Rachel |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
OK... Take 3:
Sub AddMonth() For i = 1 To Sheets.Count Sheets(i).Select Range("A1").Formula = "=today()" Range("A1").Value = Range("A1").Value Range("A1").NumberFormat = "mmmm yyyy" Range("A1").Select 'Not necessary, but you might like it... Next i Sheets(1).Select 'Not necessary, but again, you may find it useful End Sub |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
if you want the current month on EACH sheet... then use
=Text(today(),"mmm") This month it will show Nov but next month it will show Dec... If you want it in Header under PAGE SETUP, then you need a macro...similar to the one below; Sub UpdateHeader() For Each ws In Worksheets ws.PageSetup.LeftHeader = Date Next End Sub "Rachel Costanza" wrote: I have a excel workbook with 15 worksheets and every month when I produce the annualized turnover I have to go into each header on each sheet to update the month. Do you know of a way using VB or a DATE FUNCTION I can automate the template to have the current month in the header? For example: Turnover October 2008 Best, Rachel |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a excel workbook with 15 worksheets and every month when I
produce the annualized turnover I have to go into each header on each sheet to update the month. Do you know of a way using VB or a DATE FUNCTION I can automate the template to have the current month in the header? For example: Turnover October 2008 If by "header" you mean the first row of the worksheet, you can choose one sheet where the current month is entered, and have formulas in all the others that refer to that one. On the other hand, if the "header" is what's set up using File Page setup Header/Footer then you can select all worksheets at once beforehand, and the update will apply to all the worksheets. One way to do this is to right-click on one of the tabs (at the bottom of the Excel window) and choose "Select All Sheets." (I have Excel 2003.) |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a excel workbook with 15 worksheets and every month when I
produce the annualized turnover I have to go into each header on each sheet to update the month. Do you know of a way using VB or a DATE FUNCTION I can automate the template to have the current month in the header? For example: Turnover October 2008 If by "header" you mean the first row of the worksheet, you can choose one sheet where the current month is entered, and have formulas in all the others that refer to that one. On the other hand, if the "header" is what's set up using File Page setup Header/Footer then you can select all worksheets at once beforehand, and the update will apply to all the worksheets. One way to do this is to right-click on one of the tabs (at the bottom of the Excel window) and choose "Select All Sheets." (I have Excel 2003.) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Seeking the character code for entering a Hard Return in a cell? | Excel Discussion (Misc queries) | |||
Not Hard Code If | Excel Discussion (Misc queries) | |||
Hard-code source data | Charts and Charting in Excel | |||
Excel hard code those #'s without deleting the formula or typing# | Excel Discussion (Misc queries) | |||
Excel formula randomly changes to hard-code number | Excel Discussion (Misc queries) |