563 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Advanced controls in userforms with VBA macros Part nine of a nine-part series of blogs |
---|
The two previous parts of this mini-blog have shown how to draw forms and how to write code to handle form events. This final part shows how to add some of the more exotic controls to user forms, like combo boxes, list boxes, multipage controls, spinners and option buttons.
This blog is part of our Excel VBA tutorial. Wise Owl's main business is running Excel, VBA and other courses for businesses.
|
If your form needs to get a date from a user, use the built-in Calendar control:
The vanilla version of the Calendar control, with default formatting.
You can add the Calendar control from the Toolbox:
Click on the Calendar tool, and click where you want this to go.
If you can't see the Calendar tool, you may need to install this additional ActiveX control. To do this, right-click on the Toolbox and choose Additional controls. It's amazing how many there are!
You can pick up on the Value property of a Calendar control to get the date chosen by a user:
'date of order
ActiveCell.Offset(0, 6).Value = Me.calDate.Value
Because the Calendar control isn't a standard tool in the Toolbox, some properties are hidden away in the Custom category:
Click in the Custom property and then click on the build button.
You can then play about with all sorts of formatting options in the dialog box which appears:
It's worth looking at all 3 tabs of this dialog box.
And with that, I've reached the end of this blog on advanced controls.
If you're wondering why I haven't included anything on the ToggleButton, ScrollBar or RefEdit controls, it's because I don't see the point in them. I'm willing to be persuaded otherwise by comments added to this blog.
Parts of this blog |
---|
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2023. All Rights Reserved.