<<Convert Excel Spreadsheets to Web Pages | Trading Software That Operates Within Excel | Convert Excel, Access & Other Databases | Merge Excel Files>> |
---|
|
Workbook Download
This is a zipped Excel Workbook to go with this lesson.
Workbook Download
This is a zipped Excel Workbook to go with this lesson.
Finding the ActiveControl
When coding a UserForm it can often be very handy to be able to identify the current ActiveControl. By doing this, we can very easily make our code more generic and save ourselves from typing the same Procedure over and over within the Private Module of the UserForm. To identify the ActiveControl, all we really need to do is use Me.ActiveControl
An example of when this could be used could be in the situation where we have numerous Controls of the same type on a UserForm and we need to run a similar Procedure when the user activates one of the Events of the Control.
Dim iRow As Integer
The above code makes use of the ActiveControl and allow sus to place the code in one Procedure that runs the code for the ComboBox which has had its ChangeEvent fired. To see how this works and to get a better idea of how it could be done, Download and open the Workbook links at the top of this lesson.