View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Filling Column with date

Bill

try something like:

Application.ScreenUpdating = False
' Range("A5") = "01-Dec-04"
Range("B5").FormulaR1C1 = "=RC[-1]"
Range("C5").FormulaR1C1 = "=RC[-1]+1"
Range("C5").AutoFill _
Destination:=Range("C5:CQ5")
Range("B6").FormulaR1C1 = "=R[-1]C[-1]"
Range("C6").FormulaR1C1 = "=RC[-1]+1"
Range("C6").AutoFill _
Destination:=Range("C6:CQ6")
Range("B5:CQ5").NumberFormat = "d"
Range("B6:CQ6").NumberFormat = "ddd"
Range("B5:CQ6").HorizontalAlignment = xlCenter
Application.ScreenUpdating = True

Bear in mind that the number of columns will depend on how many days there
are in each of the months. I don't think there is a format that just gets
the first letter of the day of the week, hence, Mon, Tue, Wed and so on.

Regards

Trevor


"Bill" wrote in message
...
I need some help. I have a spredsheet that displays three months of dates.

I place the start date in cell A5 like 1 Dec 04. Then starting in cloumn
B5,
the Date is place in the cell. In cell B6, the day is insert.

EXAMPLE

A5 = 1 Dec 04 then
B5 = 1, and B6 = W for Wednesday
C5 = 2, and C6 = T for Thursday
D5 = 3, and D6 = F for Friday

this sequence would need to continue until the through the third month. As
in the case of this example it would need to continue through 28 Feb 05.
Can
anyone please provide me the VBA code to accomplishs this tasks.

Thanks

Bill