-
Jul 29th, 2019, 03:53 AM
#1
Thread Starter
Member
VBA Userform : Add value to textbox based on Mouse cursor
Hi Friends,
This is my Userform. When ever i press the mathematical buttons values will come in the last of textbox (refer the image). I want VBA code where these values will come where the cursor is in the textbox.
Example : I want "+" in between "(" and ")" . So basically i will add the curson between this and press the "+" button. But the values are coming in the last of this textbox.
Someone please help me .
Note : Refer the screenshot
Thanks
-
Jul 29th, 2019, 08:43 AM
#2
Re: VBA Userform : Add value to textbox based on Mouse cursor
I don't see an image, perhaps because my work is filtering out images.
I also don't see your code.
But it sounds like you just need to use the SelText property, to put the text in at the cursor position (or in place of selected text if any is selected).
Code:
Private Sub Command1_Click()
Text1.SelText = "+"
End Sub
-
Jul 29th, 2019, 09:19 AM
#3
Thread Starter
Member
Re: VBA Userform : Add value to textbox based on Mouse cursor
WoW. Thanks alot.
I was using Text1.Text instead of Text1.SelText .
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|