Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the popup calendar
I have created a popup calendar in a user form, but I can't figure out how to
get the date clicked on into a variable in a sub. Basically, I want my sub to call the calendar and assign the selected value to variable nDate to used later. Any suggestions? Erik |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the popup calendar
Private sub Calendar1_click()
ndate = userform1.calendar1.value End Sub "popup calendar" is not self defining, so that is a guess. -- Regards, Tom Ogilvy "Erik" wrote in message ... I have created a popup calendar in a user form, but I can't figure out how to get the date clicked on into a variable in a sub. Basically, I want my sub to call the calendar and assign the selected value to variable nDate to used later. Any suggestions? Erik |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the popup calendar
Right. But how do I reference ndate in a sub in module 1?
"Tom Ogilvy" wrote: Private sub Calendar1_click() ndate = userform1.calendar1.value End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the popup calendar
at the top of the module (module10) outside any procedures (subs or
functions) Public nDate as Date Sub Testit() msgbox nDate End Sub -- Regards, Tom Ogilvy "Erik" wrote in message ... Right. But how do I reference ndate in a sub in module 1? "Tom Ogilvy" wrote: Private sub Calendar1_click() ndate = userform1.calendar1.value End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the popup calendar
Thank you. I got that part of my code working.
"Tom Ogilvy" wrote: at the top of the module (module10) outside any procedures (subs or functions) Public nDate as Date Sub Testit() msgbox nDate End Sub -- Regards, Tom Ogilvy "Erik" wrote in message ... Right. But how do I reference ndate in a sub in module 1? "Tom Ogilvy" wrote: Private sub Calendar1_click() ndate = userform1.calendar1.value End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the popup calendar
The best way to do this is to create a global variable called nDate (or
whatever) in module1. You could also temporarily store the value in a worksheet form on the calendar click event, & then retrieve it in your sub procedure. "Erik" wrote: I have created a popup calendar in a user form, but I can't figure out how to get the date clicked on into a variable in a sub. Basically, I want my sub to call the calendar and assign the selected value to variable nDate to used later. Any suggestions? Erik |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Popup calendar | Excel Discussion (Misc queries) | |||
calendar popup | Excel Discussion (Misc queries) | |||
popup calendar with multiple months | Excel Discussion (Misc queries) | |||
Popup calendar | Excel Programming | |||
ms project popup calendar in excel? | Excel Programming |