View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech[_2_] Jim Rech[_2_] is offline
external usenet poster
 
Posts: 533
Default Creating User Forms

The VBE is programable so, yes, you could create a userform in the VBE.
You'd set a reference to Microsoft Visual Basic for Application
Extensibility 5.3 and start with code like this:

ActiveWorkbook.VBProject.VBComponents.Add vbext_ct_MSForm

You'd have to set "Trust access to Visual Basic Project" on under Tools,
Macro, Security _in Excel_ before this code will be allowed to run. (Macro
virus protection).

However I don't know why you'd want to do that. The better way is to create
the userform via the designer in the VBE and add the stock controls you'll
need. Then during the Initialize event your code can customize its
appearance dynamically using, if you want, variables in the sheet.

--
Jim
"wutzke" wrote in message
...
Is there a way to create a user form programically?
If I had values in a row (item 1, item2, item3, ...)
and values in the next row representing quantities
can VB create a user form dynamically from these cells?