Pop-Up Calendar
What is not working for you - there are 2 pieces to Ron's code: moving value
from the calendar(s) to the worksheet, and the other way around.
I placed 3 calendar controls on an Excel 2003 sheet and this code worked for
me:
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
End Sub
Private Sub Calendar2_Click()
ActiveCell.Value = CDbl(Calendar2.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
End Sub
Private Sub Calendar3_Click()
ActiveCell.Value = CDbl(Calendar3.Value)
ActiveCell.NumberFormat = "mm/dd/yyyy"
ActiveCell.Select
End Sub
Did you put the code into the worksheet's code module? Choose the sheet
with the calendar controls on it and then right-click the sheet's name tab
and choose [View Code] from the list. The code module for the worksheet will
appear and that is the module that you should put the code into.
"Lynda" wrote:
I have an Excel 2003 spreadsheet with 3 separate pop-up calendars, basically
there is one at the top, one in the middle and one at the end. I used Ron de
Bruins code for his pop up calendar. I changed the code to €˜calendar 2 and
€˜calendar3 to hopefully get them to work separately but it doesnt seem to
work. Could someone advise me on what I may be doing wrong.
Lynda
|