ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm implementation (https://www.excelbanter.com/excel-programming/307846-userform-implementation.html)

Fernando Ronci

UserForm implementation
 
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:



Chip Pearson

UserForm implementation
 
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



"Fernando Ronci" wrote in message
...
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:






All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com