I would suggest you to have another text box or a label with the visible property set to invisible.
Set the text value to 1 , 2 and so on based on the text box clicked. Let us assume that the invisible text box is called as txt_Sel
Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
txt_sel.Text = 1
End Sub
Private Sub TextBox2_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
txt_sel.Text = 2
End Sub
When the user clicks the command box assign the value to that text box like this :
Private Sub CommandButton1_Click()
UserForm1.Controls("TextBox" & txt_sel.Text).Text = 100
End Sub
Bookmarks