Hi,
I am looking for either a formula or code to execute the following:
Start Month = X
Number of Months = Y
and then autofill a row based on the following number of months from
the start month.
any suggestions.
Thanks
Hi,
I am looking for either a formula or code to execute the following:
Start Month = X
Number of Months = Y
and then autofill a row based on the following number of months from
the start month.
any suggestions.
Thanks
You can do it with VBA as follows:
Sub CreateMonths(StartMonth As Long, NumMonths As Long, Rng As
Range)
Dim Ndx As Long
For Ndx = StartMonth To StartMonth + NumMonths - 1
Rng = DateSerial(Year(Now), Ndx, 1)
Set Rng = Rng(2, 1)
Next Ndx
End Sub
Sub BBB()
CreateMonths StartMonth:=5, NumMonths:=6, Rng:=Range("a1")
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"jsr" <reitman@931media.com> wrote in message
news:1150294775.204964.271460@g10g2000cwb.googlegroups.com...
> Hi,
> I am looking for either a formula or code to execute the
> following:
>
> Start Month = X
> Number of Months = Y
>
> and then autofill a row based on the following number of months
> from
> the start month.
>
> any suggestions.
>
> Thanks
>
Hi
P.e. you have in cell B1 start month, entered as any date from this month
(I'd prefer 1st of month), and formatted as "yyyy mmmm", or "yyyy mmm", or
"yyyy.mm", and in cell B2 the number of months.
A3="Months"
A4=IF(ROW()-3>$B$2,"",DATE(YEAR($B$1),MONTH($B$1)+ROW()-4,1))
Format A2 as "yyyy mmmm", or "yyyy mmm", or "yyyy.mm" ... , and copy down as
much as you need.
Arvi Laanemets
"jsr" <reitman@931media.com> wrote in message
news:1150294775.204964.271460@g10g2000cwb.googlegroups.com...
> Hi,
> I am looking for either a formula or code to execute the following:
>
> Start Month = X
> Number of Months = Y
>
> and then autofill a row based on the following number of months from
> the start month.
>
> any suggestions.
>
> Thanks
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks