How to select a particular line in multi line text box

angsuman

New Member
Joined
Aug 19, 2015
Messages
30
Hello All,


Need help on how to select a particular line in multi line text box. I have a text box with multi line which contains several line with name of countries. I perform single click on one of the country and expect that particular line will be highlighted. Followup action will be delete the line if delete command button is selected. Which event of text box should I select to know the position of cursor when a line is clicked? I do not see any click event on text box.


Thanks
Angsuman
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You said:
in multi line text box

So this is not a activex Textbox

So your talking about a Text Box from the Insert Menu
Not a TextBox from the Developer

You can have lots of lines but this is not considered as Multiline
Or explain exactly what type control your talking about please.






 
Upvote 0
I am using an user form and text box control is added to user form from tool box. The text box property is set as multi line = True and EnterKeyBehaviour = True. Tool box is not added dynamically. Hope this makes sense.
 
Upvote 0
Well knowing this is on a UserForm Help
But I'm not sure how to do what you want.
Maybe someone else here at Mr. Excel will be able to help you

I have never used a Multiline TextBox
 
Upvote 0
So how are you entering all these values into the Textbox?

Your surely not entering them manually and then wanting to delete one after entering it.
 
Upvote 0
I can either enter data manually one by one or I can copy and paste it inside the text box. However I am doing it now by copying and pasting it inside the text box. I think I need to get the cursor position once I click on any text. Based on the cursor position probably I will find out line number or locate the text. Once this is done, I can select it and then delete. However I do not see any option to get the location of the cursor once I click on any text inside the text box.
 
Upvote 0
I really do not think a vba script will be able to do this. But maybe there is and I will learn something also.

Maybe I should ask.
What is your ultimate Goal.

What will you do with this data after entering it?
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top