I was using the following code to select text inside a text box of a userform everytime I clicked on it, however I have almost 40 text boxes and I would like to know if there's a way to write a single code for all of them instead of copying and pasting this same piece of code 40 times.
Private Sub textbox1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer,ByVal X As Single, ByVal y As Single)
With Me.textbox1
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub