Variables in a Userform

B

Bishop

Is there a way to use a variable in a userform text box? I have a Userform
I'm creating that has a text box. I want the text to say: "The following X
files will be consolidated for the month of Y." I will have variables X and
Y such that X will be equal to some integer and Y will be some string that
will be the name of a particular month. So say I have X = 4 and Y = March
then my text box should read: "The following 4 files will be consolidated for
the month of March."

How do I do this?
 
D

dmoney

Private Sub CommandButton1_Click()
Dim x As Variant
Dim y As String
x = 4
y = "March"

TextBox1.Text = "The following " & x & " files will be consolidated for the
month of " & y & ""

End Sub
 

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

Top