Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calendar Contol with mutiple textboxes
I am using the Textbox_Entyer event to trigger the frmCalender to appear and when a date is selected
it places the date into Textbox1 However further down on the form i have another date textbox (Textbox33) How can use the SAME frmCalendar to input the date here into Textbox33 as with Textbox1 ? As the code line i am using to input the date from the Calendar is : Private Sub Calendar1_Click() With UserForm1 TextBox1.Value = Calendar1.Value Unload Me End Sub Is there a way to have something like: Activetextbox or If textbox.setfocus = true then They did not work though I do not want to add a2nd frmCalendar Corey.... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calendar Contol with mutiple textboxes
Hi Corey
I don't have the calendar control installed on this computer but i believe the code below should work for you though i can't test it as i said. Option Explicit Dim Ctrl As MSForms.Control Private Sub TextBox1_Enter() Set Ctrl = UserForm1.Controls("TextBox1") 'call calendar control End Sub Private Sub TextBox33_Enter() Set Ctrl = UserForm1.Controls("TextBox33") 'call calendar control End Sub Private Sub Calendar1_Click() Ctrl.Value = Calendar1.Value Unload Me End Sub hope this helps S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running mutiple excel sheets on mutiple computers | Excel Discussion (Misc queries) | |||
Accessing Mutiple TextBoxes | Excel Programming | |||
Accessing Mutiple TextBoxes | Excel Programming | |||
Accessing Mutiple TextBoxes | Excel Programming | |||
Accessing Mutiple TextBoxes | Excel Programming |