Mike wants to know how to open a userform when he opens his Excel workbook and how to close the userform once the work is finished. We quickly design the userform using labels, textboxes and command buttons. Then we code the userform to open automatically and the appropriate button to close the userform once the data entry work is finished.
We have earlier learnt how to design and code such a userform.
The Excel VBA or macro code for opening the userform is given below:
Private Sub Workbook_Open()
The macro code for the ‘close’ code is:
Private Sub CommandButton2_Click()
Watch the Excel training video below to see how the complete process is implemented: