Code:
Public Sub gSelectText(txtText As TextBox)
On Error Resume Next
  txtText.SelStart = 0
  txtText.SelLength = Len(txtText)
End Sub
on the GotFocus-event, call this procedure, like this:;

Code:
Private Sub Text1_GotFocus()
  Call gSelectText(Text1)
End Sub