![]() Then, this code above loops through all userforms in your project until it finds one that matches the label for the Userform (lblUF) and the label for the textbox needed (lblCtrlName).Īlso, you may need to enable Microsoft Windows Common Controls -2 6. 1.) The name of the userform that called it and 2.) The name of the control or textbox that needs the date sent to it. This userform cleverly has two labels to store relevant info on the Userform that summoned it. To launch a form, you need the Show method after the name of your form: UserForm1.Show. When the Assign Macro dialogue box appears, select Button1Click: When you click OK, you should see a coding window appear. Go back to your spreadsheet and add a new button. When you double-click the control you’ll see the following code which is the DateClick event of that control: Launch a Form from a Button on a Spreadsheet. In the downloadable workbook, you’ll see the control was renamed to ‘fCal’. Start by creating a userform and enabling the control by Right-clicking on the Tools menu and click Add additional tools It’s a little old school looking, but actually has quite a nice feel to it. Check out this ActiveX control by Microsoft that allows users to do just that. This is no different for Excel developers. Oftentimes, users want to click a button and select a date.
0 Comments
Leave a Reply. |