View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Month Names as ComboBox List

Abdul,
assuming you a suitable range named "MyDates"

Private Sub CommandButton1_Click()
Dim StartMonth As Long
Dim EndMonth As Long
Dim i As Long

StartMonth = Month(Application.WorksheetFunction.Min(Range("MyD ates")))
EndMonth = Month(Application.WorksheetFunction.Max(Range("MyD ates")))

With ComboBox1
.Clear
For i = StartMonth To EndMonth
.AddItem MonthName(i)
Next
End With
End Sub

NickHK

"Abdul" wrote in message
ps.com...
Hello!,

I have dates in Column A of sheet1

I want add month names as my combobox1 list but to include only the
months available in column A

for eg: if the first date is 16/6/06 and last date is 1/10/06 then i
want only June thru october to show in the list..

How can i do this

thanks