Months and Dates

  • Thread starter Thread starter adn4n
  • Start date Start date
A

adn4n

Hi, im looking to enter the Months of the year into a combo box, whic
is what i have done .....but can any one please help me on how to ge
the dates according to that month to show up underneath, so that i ca
have a timesheet according to the relevant month.. e.g Jan, 31 days, i
list of dates... etc etc Thankyou
 
Here's some code

Private Sub ComboBox1_Change()
Dim i As Long
Dim dteCombo As Date

Range("A1:A31").ClearContents
For i = 1 To 31
dteCombo = DateSerial(Year(Date), ComboBox1.ListIndex + 1, i)
If Month(dteCombo) = ComboBox1.ListIndex + 1 Then
Cells(i, "A").Value = dteCombo
Else
Exit For
End If
Next i
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top