Thread
:
Custom fill series?
View Single Post
#
11
Posted to microsoft.public.excel.misc
Don Guillett
Posts: n/a
Custom fill series?
Thanks for catching that. Of course, this is, by far, the easiest way to get
it done.
--
Don Guillett
SalesAid Software
"David" wrote in message
...
Need to modify Case statements:
Select Case Day(mdate)
Case 1, 21, 31: x = "st"
Case 2, 22: x = "nd"
Case 3, 23: x = "rd"
Case Else: x = "th"
End Select
--
David
Don Guillett wrote
If you liked the formula you will really like this. Position the
cursor where you want the dates to start. Execute the macro. You will
be asked for the first date and the number of weeks desired.
Sub datefillcustom()
ac = ActiveCell.Column
ar = ActiveCell.Row - 1
md = InputBox("Enter date like 01/28/06")
If Not IsDate(md) Then
MsgBox "Start Over"
Exit Sub
End If
mdate = DateSerial(Year(md), Month(md), Day(md))
For i = 1 To InputBox("Enter number of weeks desired")
Select Case Day(mdate)
Case 1: x = "st"
Case 2: x = "nd"
Case 3: x = "rd"
Case Is 3: x = "th"
Case Else
End Select
Cells(ar + i, ac).Value = Day(mdate) & x & Format(mdate, " mmm, yyyy")
mdate = mdate + 7
Next i
Reply With Quote