Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi...
I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you also mean that if the first value is, say, feb, then your array would
start with FEb, and be filled in with the next 11 months in calendar order? wrote in message ... hi... I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
yes thats exactly what i wanted..not sure if its
feasible... -----Original Message----- Do you also mean that if the first value is, say, feb, then your array would start with FEb, and be filled in with the next 11 months in calendar order? wrote in message ... hi... I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Tester1AAA()
Dim mths(1 To 12) as String j = 2 For i = 1 To 12 mths(i) = Format(DateSerial(Year(Date), j, 1), "mmmm") j = j + 1 Next For i = 1 To 12 Debug.Print mths(i) Next End Sub Excel will "roll" the month back to January after you reach December and give you the correct result regardless of the start month. -- Regards, Tom Ogilvy wrote in message ... yes thats exactly what i wanted..not sure if its feasible... -----Original Message----- Do you also mean that if the first value is, say, feb, then your array would start with FEb, and be filled in with the next 11 months in calendar order? wrote in message ... hi... I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Anything's possible :)
Function setMonths(FirstMonth As Byte) As String() Dim MthNames(11) As String, i As Byte For i = 0 To 11 MthNames(i) = Choose((FirstMonth + i - 1) Mod 12 + 1, _ "Jan", "Feb", "Mar", "Apr", "May", "Jun", _ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") Next i setMonths = MthNames End Function Sub testIt2() Dim MthNames() As String, FirstMonth As Byte FirstMonth = 6 MthNames = setMonths(FirstMonth) End Sub The above needs VB6. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... hi... I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't know how you want it set up, but would any ideas here help? Later
versions of Excel make this faster. Sub Demo() Dim Months(1 To 12) As String Dim Start As Long Dim Mth As Long Start = 10 'October For Mth = 1 To 12 Months(Mth) = MonthName(((Mth + Start - 2) Mod 12) + 1) Next Mth End Sub -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = wrote in message ... hi... I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks all for the possiblities..:-)
-----Original Message----- hi... I want to run a loop such that if the starting value is oct then my array arrMonth() should start with OCtober or OCt and the remaining 11 months be filled automatically... is it feasible? thanks a lot . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically update month | Excel Discussion (Misc queries) | |||
How to automatically update a 12 month budget | Excel Discussion (Misc queries) | |||
First day and Last day of the month to display automatically | Excel Discussion (Misc queries) | |||
how do I automatically sequence the month | Excel Worksheet Functions | |||
Setting up a Month Array | Excel Programming |