View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default userform parameters

You can easily accept parameters for the userform - but how do you want them
entered? In worksheet cells, or in a dialog box? This shows examples of
both, prompting the user for one parameter and taking the second from Cell
A1. The userform needs two textboxes, Textbox1 and Textbox2, for this
example:

Sub TestForm()
Dim Param1 As String

Param1 = InputBox("Enter Parameter 1:")
UserForm1.TextBox1 = Param1
UserForm1.TextBox2 = Range("A1").Value
UserForm1.Show

End Sub

--
- K Dales


"Mike Archer" wrote:

Hello - I have a lot of userforms that use global variables that are created
just for the purpose of populating the userforms. Is there a way to create a
userform that accepts parameters? How? And what would be the syntax to show
the userform ans pass the parameters to it?
--
Thanks,
Mike