Try this:
Private Sub CommandButton1_Click()
setar (1)
'when Command Button 1 is clicked it sends the number 1 as a variable to
the code
End Sub
__________________________________________________ ___________
Private Sub CommandButton2_Click()
setar (2)
'when Command Button 2 is clicked it sends the number 2 as a variable to
the code
End Sub
__________________________________________________ ___________
Private Sub setar(ArgValue as Integer)
UserForm1.Controls("TextBox" & ArgValue).Text = "This is my test text"
'Missing something here
End Sub
Let me know if that doesn't work.
Mark
---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!