Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message oups.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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message oups.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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FORMULA TO INCREMENT 25 MONTHS BASED ON A DATE CELL | Excel Discussion (Misc queries) | |||
Start Date minus (Years + Months + Days) = ? | Excel Programming | |||
Code for auto filling in Excel based on number of months, & start date | Excel Programming | |||
AutoFill Visible Cells with Months | New Users to Excel | |||
Formula to calucate # of months based on a speificed date entered | Excel Worksheet Functions |