Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Generate calendar column month headers in YYMM Format

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Generate calendar column month headers in YYMM Format

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Generate calendar column month headers in YYMM Format

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
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
Date: End of last month as YYMM Bythsx-Addagio[_2_] Excel Programming 2 May 24th 07 11:05 AM
Format entire column with Calendar activex control? chantal0123 Excel Discussion (Misc queries) 3 June 2nd 06 08:51 PM
Saving file in the format "YYMM" Dolphinv4 Excel Discussion (Misc queries) 2 October 5th 05 12:08 PM
Macro to auto save file using the format YYMM Dolphinv4 Excel Discussion (Misc queries) 1 September 29th 05 04:09 AM
is there a formula to generate a calendar month date rather than . lmurray Excel Worksheet Functions 1 January 21st 05 03:24 PM


All times are GMT +1. The time now is 10:48 AM.

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

About Us

"It's about Microsoft Excel"