BogdanBogdan
11-07-2018, 01:44 PM
Insert symbol into text box - in the active textbox where the mouse cursor is located:
I have code :
=====================================================
Private Sub CommandButton1_Click()
Dim doClip As DataObject
Dim bulletStr As String
Set doClip = New DataObject
bulletStr = "• "
doClip.SetText bulletStr
doClip.PutInClipboard
With Me.TextBox1
.Paste
.SetFocus
End With
End Sub
=====================================================
An I have 5 textbox . VBA Code from above is work only for "TextBox1"....but if I select TextBox 2 ( or other ) and give click on button....also in my textbox1 inserts the symbol. I do not know how to do this process to see the textbox I've selected with the mouse, and to insert my symbol when I press the insert button.
Can you help me with that ?
Please, see my file in attach.
Thank you in advance,
Bogdan23169
I have code :
=====================================================
Private Sub CommandButton1_Click()
Dim doClip As DataObject
Dim bulletStr As String
Set doClip = New DataObject
bulletStr = "• "
doClip.SetText bulletStr
doClip.PutInClipboard
With Me.TextBox1
.Paste
.SetFocus
End With
End Sub
=====================================================
An I have 5 textbox . VBA Code from above is work only for "TextBox1"....but if I select TextBox 2 ( or other ) and give click on button....also in my textbox1 inserts the symbol. I do not know how to do this process to see the textbox I've selected with the mouse, and to insert my symbol when I press the insert button.
Can you help me with that ?
Please, see my file in attach.
Thank you in advance,
Bogdan23169