Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Pop-Up Calendar
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Pop-Up Calendar
On the off chance that your calendars were given names other than Calendar1,
Calendar2 and Calendar3 you can use this code to determine what their names on the sheet a Sub GetShapesNames() Dim anyShape As Shape For Each anyShape In ActiveSheet.Shapes MsgBox anyShape.Name Next End Sub You can put that code into a standard code module or even into the worksheet's code module and run it from there using [F5] while in the VB Editor. It will show you the names of all shapes on the active sheet, one at a time. "JLatham" wrote: 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 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Pop-Up Calendar
Thank you 'J', I have used Ron's code before on many other sheets and the
'Calendar1' code is working fine, but for some reason when I change it to Calendar2 and Calendar3 these 2 don't want to work. I have a lot of code on sheet1 those being code for triple drop-downs and then more code for a single drop-down. If there is too much code on one sheet will that start to affect the operation of the other codes? "JLatham" wrote: On the off chance that your calendars were given names other than Calendar1, Calendar2 and Calendar3 you can use this code to determine what their names on the sheet a Sub GetShapesNames() Dim anyShape As Shape For Each anyShape In ActiveSheet.Shapes MsgBox anyShape.Name Next End Sub You can put that code into a standard code module or even into the worksheet's code module and run it from there using [F5] while in the VB Editor. It will show you the names of all shapes on the active sheet, one at a time. "JLatham" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Convert date from Gregorian Calendar to Hijri Calendar | Excel Discussion (Misc queries) | |||
find free sharware to include calendar pop or use calendar in cell | Excel Discussion (Misc queries) | |||
how do i export excel calendar info to outlook calendar? | Excel Discussion (Misc queries) | |||
excel calendar - list of names displayed on calendar | Excel Worksheet Functions | |||
import calendar items from excel into outlook calendar | Excel Discussion (Misc queries) |