calendar control

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hello group,

How can I get the number of the month when the new month event happens,
I'm trying to display a spreadsheet in a userform depending on the month the
user has chosen, see code

'msgbox calendar1.month <- this returns a 0, it does return the month number
only if I click in a new
month but if I select the month in the combo box nothing would happen

Private Sub Calendar1_NewMonth()

If Calendar1.Month = 3 Then
UserForm4.Spreadsheet1.HTMLURL = "H:\Gerardo\p_mar.htm"
ElseIf Calendar1.Month = 2 Then
UserForm4.Spreadsheet1.HTMLURL = "H:\Gerardo\p_feb.htm"
Else
MsgBox "No data was found for selected date", vbExclamation
End If

End Sub

please advice
thanks to all !!
Gerardo
 

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

Back
Top