UserForm implementation

  • Thread starter Thread starter Fernando Ronci
  • Start date Start date
F

Fernando Ronci

Hi,

Sorry for this elementary question, but I'm mostly new to Excel programming.
I'd like to know how UserForms are called from within a spreadsheet. For
example, in the VBA editor I inserted a UserForm (named UserForm1) and added
a bunch of controls together with their corresponding "Private Subs" and the
Visual Basic code that performs the intended tasks with data from the
spreadsheet.
I test the Private Subs (or UserForm1 better said) with F5 and everything is
OK, however the end user of the spreadsheet isn't supposed to need to jump
to the VBA editor and hit F5 to work with the UserForm, so I'd like to know
how the UserForm is displayed with or linked to (I don't know how this is
called actually) the spreadsheet so that he/she interacts with it in the
same fashion as with controls bound to ordinary macros that get displayed
*with* the spreadsheet. I devoted some time to browsing both Excel's and VBA
editor's menus and on-line help but couldn't figure out how this is
achieved.

Thank you,

Fernando Ronci
E-mail: (e-mail address removed)
 
Once you've created a userform, create a macro to display it.
E.g.,

Sub DisplayForm()
Userform1.Show
End Sub

Then, the user can execute this macro directly (ALT+F8 or Tools
menu, Macros, Macros) or you can create a command bar button or
menu item and assign the above macro to that control.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top