Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Hard code month in Excel

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default Hard code month in Excel

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default Hard code month in Excel

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default Hard code month in Excel

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Hard code month in Excel

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Hard code month in Excel

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Hard code month in Excel

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking the character code for entering a Hard Return in a cell? JKing Excel Discussion (Misc queries) 2 June 4th 08 11:06 PM
Not Hard Code If FIRSTROUNDKO via OfficeKB.com Excel Discussion (Misc queries) 3 July 10th 07 04:11 PM
Hard-code source data Melanie Martin Charts and Charting in Excel 5 December 29th 05 02:07 PM
Excel hard code those #'s without deleting the formula or typing# JudiS Excel Discussion (Misc queries) 1 August 1st 05 11:21 PM
Excel formula randomly changes to hard-code number Ned Excel Discussion (Misc queries) 3 February 14th 05 11:31 PM


All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"