Hi, I have a multiline textbox in a userform and would like to be able to:
1. Hit return for a new line.
2: Change the carriage returns to
, the html version of a new line.
Then copy the result into a cell.
Hello Andy:
1. On your userform property, make sure the textbox's enterkeybehavior is set to true, this enable the enter key to generate a new line.
2. the new line character is either chr(13) then chr(10) or chr(10) then chr(13), I forget which one is the right one, but you can easily test it. just do a search and replace of both character with the html ones.
example:
dim strAns as string
strAns = textbox1.text
strAns = replace (strAns,chr(13) & chr (10)," ")
3. not sure what you mean, but it should be easy once you got the string above?
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.