Autofill months in cell

  • Thread starter Thread starter paradise
  • Start date Start date
P

paradise

I have a combobox in userform containing months like January,

February, March,so on. How do i write a code such that if the user

select a particular month (say January) in the combobox, it will be

written to cell A1, after which the program could autofill the months

from cell A2 downwards, reflecting February, March, and so on.?

Thanks:)
 
(Untested):

Dim i As Integer
For i = 1 to 12
Range("A" & i) = CStr(Format(DateSerial(Year(Date), _
Month(DateValue("1-" & UserForm1.ComboBox1)) + i, 1), "mmmm"))
Next i
 
Back
Top