Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From the given First Month and Last Month dates, for instance
11/15/2008 and 03/20/2009, how do I loop and generate with VBA the columns headers of 0811, 0812, 0901, 0902, 0903. Thank you for your help. J.P. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Right click your sheet tab, view code and paste the code below in and run it. It picks up startdate and enddate from a1 and B1 respectively Sub FillCalendar() Dim startdate As Date, enddate As Date startdate = Range("A1").Value enddate = Range("B1").Value x = 1 Do With Cells(2, x) .Value = startdate .NumberFormat = "mmyy" End With startdate = DateAdd("m", 1, startdate) x = x + 1 Loop Until startdate enddate End Sub Mike On Dec 26, 9:25*am, u473 wrote: From the given First Month and Last Month dates, for instance 11/15/2008 and 03/20/2009, *how do I loop and generate with VBA the columns headers of *0811, 0812, 0901, 0902, 0903. Thank you for your help. J.P. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much. Your answer was very much appreciated.
Assuming that I push that calendar 2 columns to the right and have a column of unique dates in A, and Values in B column, like : A B 11/15/2008 15,000 12/25/2008 8,000 02/05/2009 12,000 How do I distribute these values in their respective columns ? I know I have to loop thru the range in column A, but how do I refer to the appropriate column ? Thank you again and have Happy Holidays ! J.P. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date: End of last month as YYMM | Excel Programming | |||
Format entire column with Calendar activex control? | Excel Discussion (Misc queries) | |||
Saving file in the format "YYMM" | Excel Discussion (Misc queries) | |||
Macro to auto save file using the format YYMM | Excel Discussion (Misc queries) | |||
is there a formula to generate a calendar month date rather than . | Excel Worksheet Functions |