Highlighting the contents of a textbox on mouse click in a user's interface eases data entering. To do so, simply enter the following code under the Userform VBA code:
Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, _
ByVal X As Single, ByVal Y As Single)With TextBox1
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Created by DoMyExcel.com © | Excel & VBA Consulting | Customized Excel Solutions starting at 29 USD
Services provided to Individuals and Businesses | Free Quote: DoMyExcel@gmail.com
No comments:
Post a Comment