Context: I have 10 text boxes (ID1 To ID10) in a user form. The userform will also have a clear button, which will allow the user to clear all the values previously entered in the text box. For that I have inserted the below mentioned command in the Clear Button.
I have multiple commands with the same nomenclature except the number which varies with every text box. I wish to enter one command which will change number and execute all the commands.
Simple example given below: I wish to only put one command instead of the folloing:
Private Sub btnClear_Click()
'Empty ID1
ID1.Value = ""
'Empty ID2
ID2.Value = ""
'Empty ID3
ID3.Value = ""
. . . and so on till .
'Empty ID10
ID10.Value = ""
End Sub
I know there is a solution to this, but since I am new cannot find on google using the correct key words. Sorry if this already exists. Any help will be appreciated. Thank you.