Loop when Calendar Selected

Rocky0201

Active Member
Joined
Aug 20, 2009
Messages
278
Hi...

I entered code In my UserForm1 to pop up a calendar when TextBox18 is double clicked.

Private Sub TextBox18_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
UserForm3.Show
TextBox18.Value = DateValueText
End Sub

The code for my calendar is:

Private Sub Calendar1_Click()
DateValueText = Calendar1.Value
Unload Me
End Sub
Private Sub UserForm_Initialize()
Calendar1.Value = Date

End Sub

After the Calendar pops up and I select a date from the calendar, the code goes into a loop and I have to press the reset button in my macro screen.

If I put a breakpoint at TextBox18.Value = DateValueText in UserForm1, The loop does not happen.

Please let me know what I am doing wrong.

I am using Excel 2007. The additional controls that I used is Calendar Controls 12.0.

Thanks...
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try:
Rich (BB code):
Private Sub TextBox18_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    UserForm3.Show
    Me.Hide
    TextBox18.Value = DateValueText
    Me.Show
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top