I have a cell linked to a Access query which contains a stored month name. For example, the access user selects the starting month of a financial period. After inserting the starting month name (i.e. March) I would like the next 11 horizontal cells to fill in the next 11 months. I tried the date addition function with no luck. Any ideas?
Check out this
http://chandoo.org/wp/2010/04/06/rolling-months/
Thanks
If we assume A1 holds MARCH as a text string you might consider:
Note though the above is returning a string not a date per se.B1: =UPPER(TEXT(DATE(1905,MONTH(1&A1)+1,1),"mmmm")) copied across to L1
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Use the autofill-grip (the cross in the right down corner of the cell)
or, if 'march' is in cell A9:
Sub snb() Cells(9, 1).AutoFill Cells(9, 1).Resize(, 11) End Sub
Last edited by snb; 03-10-2011 at 04:37 AM.
The implication is that this needs to be dynamic though granted you could automate the AutoFill via Change Event - I confess that a formula approach seemed a little more obvious to me.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks