Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
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) |