LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Create UserForm programmatically

Ber,
Borrowing liberally from John Walkenbach's web site...
http://j-walk.com/ss/excel/tips/tip76.htm
'------------------
Sub MakeOne()
Dim frmNew As Object
Set frmNew = ThisWorkbook.VBProject.VBComponents.Add(3)
frmNew.Properties("Caption") = " Test Form"
VBA.UserForms.Add(frmNew.Name).Show
ThisWorkbook.VBProject.VBComponents.Remove VBComponent:=frmNew
Set frmNew = Nothing
End Sub
'--------------------------
Jim Cone
San Francisco, USA



"Ber"
wrote in message

An Excel worksheet contains a list of names.
When the user selects one of these names, a userform pops up. This Userform
has the same name as the name that is selected in the worksheet.
What I want to achieve is that whenever a name is selected for which there
does not excist a UserForm yet, this form will be created programmatically.
My question is: How can I generate and name a userform in Excel and furnish
it with a textbox..
I have tried Google Groups to no avail.
A search of the Microsoft Knowledge Base came up with the answer, all the
details and sample routines but ..... for Word2000 only - see
http://tinyurl.com/79tn2 .
Your help will be appreciated
Ber


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW-TO: programmatically create SAS length statement William W. Viergever Excel Discussion (Misc queries) 1 January 13th 09 09:47 AM
programmatically create a macro Jim Warren Excel Programming 2 March 16th 05 10:57 PM
delete Userform control programmatically ben Excel Programming 8 February 15th 05 08:14 PM
help with create spreadsheet programmatically Divyesh Raithatha Excel Programming 1 October 4th 03 08:02 AM
How to create picklists programmatically Harald Staff[_4_] Excel Programming 0 July 16th 03 09:59 AM


All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"