Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Popup calendar GerryK Excel Discussion (Misc queries) 1 April 4th 07 07:14 PM
calendar popup Aaron Excel Discussion (Misc queries) 1 May 11th 06 02:52 PM
popup calendar with multiple months shawn Excel Discussion (Misc queries) 0 December 28th 05 02:55 AM
Popup calendar Ron de Bruin Excel Programming 0 July 2nd 04 04:36 PM
ms project popup calendar in excel? Baboo Excel Programming 7 October 23rd 03 10:55 PM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"