#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Pop-up calendar

We use a pop-up calendar in one of our forms for users to select a start and
end date (only one calendar for both selections). Once the user selects a
start date, is there a way to have the calendar "pop-up" in the same month as
the start date rather than the default current month?

I've learned a great deal from reading other posts! This is a great place
for new "bigger, better, faster" ideas!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 118
Default Pop-up calendar

Hi BBFan

I'm not sure which Pop up calender you are using but below is a procedure
which uses the Microsoft DateTime Picker. When the start date is changed,
then the end date value tracks it. Be careful with this because if you change
the start date after you pick your end date, your end date will change.

Note the below procedure is inserted into the code for the userform NOT a
separate module. DTPicker1 is the start date and DTPicker2 is the end date.

Private Sub DTPicker1_Change()
DTPicker2.Value = DTPicker1.Value
End Sub

If this helps please click "Yes"
<<<<<<<<<<

"BumblebeeFan" wrote:

We use a pop-up calendar in one of our forms for users to select a start and
end date (only one calendar for both selections). Once the user selects a
start date, is there a way to have the calendar "pop-up" in the same month as
the start date rather than the default current month?

I've learned a great deal from reading other posts! This is a great place
for new "bigger, better, faster" ideas!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Pop-up calendar

Hi Rick,

Sorry... but think I'm lost. Maybe it'll help if I show you the calendar?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Dim Rng1 As Range

'Assign the range to work with
Set Rng1 = Range("b12,g12")

'Only work on assigned range
If Intersect(Target, Rng1) Is Nothing Then Exit Sub

'Cancel cell editing that would normally trigger when you double click
Cancel = True

'Call the userform
UserForm1.Show

End Sub

I added the DTPicker just below - think I've completely misunderstood what
to do...

BBFan

"BSc Chem Eng Rick" wrote:

Hi BBFan

I'm not sure which Pop up calender you are using but below is a procedure
which uses the Microsoft DateTime Picker. When the start date is changed,
then the end date value tracks it. Be careful with this because if you change
the start date after you pick your end date, your end date will change.

Note the below procedure is inserted into the code for the userform NOT a
separate module. DTPicker1 is the start date and DTPicker2 is the end date.

Private Sub DTPicker1_Change()
DTPicker2.Value = DTPicker1.Value
End Sub

If this helps please click "Yes"


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 118
Default Pop-up calendar

Just to make sure I understand, the pop-up calender is a Control in
"Userform1" right? If that is the case, what control is it? You can see this
by opening up the properties window and seeing the description next to
"(Name)" when you click on the calender control.

Once you identify the name of your control, click the Userform and press
"F7" to go to the code for the Userform itself (you could also do this by
right clicking the Userform in the Project window and selecting "View Code").
Now you will see two drop-down menus at the top just under all the toolbars.
In the left hand drop-down you want to select the Pop-up calender we
identified above for your start date. You will see that some code is
automatically entered but it is more than likely the wrong event, so click
the right hand drop down and find the event "Change". This will initialise
another "Private Sub". Now all you do is put the code I gave you earlier into
that sub and there you have it.



"BumblebeeFan" wrote:

Hi Rick,

Sorry... but think I'm lost. Maybe it'll help if I show you the calendar?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Dim Rng1 As Range

'Assign the range to work with
Set Rng1 = Range("b12,g12")

'Only work on assigned range
If Intersect(Target, Rng1) Is Nothing Then Exit Sub

'Cancel cell editing that would normally trigger when you double click
Cancel = True

'Call the userform
UserForm1.Show

End Sub

I added the DTPicker just below - think I've completely misunderstood what
to do...

BBFan

"BSc Chem Eng Rick" wrote:

Hi BBFan

I'm not sure which Pop up calender you are using but below is a procedure
which uses the Microsoft DateTime Picker. When the start date is changed,
then the end date value tracks it. Be careful with this because if you change
the start date after you pick your end date, your end date will change.

Note the below procedure is inserted into the code for the userform NOT a
separate module. DTPicker1 is the start date and DTPicker2 is the end date.

Private Sub DTPicker1_Change()
DTPicker2.Value = DTPicker1.Value
End Sub

If this helps please click "Yes"


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Pop-up calendar

Thanks! I'm copying this and working on it (at work <grin) tomorrow... will
give you an 'update' tomorrow after work. Thanks again for your time and
explanation.

"BSc Chem Eng Rick" wrote:

Just to make sure I understand, the pop-up calender is a Control in
"Userform1" right? If that is the case, what control is it? You can see this
by opening up the properties window and seeing the description next to
"(Name)" when you click on the calender control.

Once you identify the name of your control, click the Userform and press
"F7" to go to the code for the Userform itself (you could also do this by
right clicking the Userform in the Project window and selecting "View Code").
Now you will see two drop-down menus at the top just under all the toolbars.
In the left hand drop-down you want to select the Pop-up calender we
identified above for your start date. You will see that some code is
automatically entered but it is more than likely the wrong event, so click
the right hand drop down and find the event "Change". This will initialise
another "Private Sub". Now all you do is put the code I gave you earlier into
that sub and there you have it.


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
Convert date from Gregorian Calendar to Hijri Calendar H.Alkhodary Excel Discussion (Misc queries) 1 February 21st 09 10:11 AM
find free sharware to include calendar pop or use calendar in cell ednc Excel Discussion (Misc queries) 2 April 14th 08 05:05 PM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
excel calendar - list of names displayed on calendar Brian'88 Excel Worksheet Functions 3 November 17th 06 10:31 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM


All times are GMT +1. The time now is 02:27 AM.

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"