![]() |
2 small problems
Hi.
I have a txtbox (with multiline) on a userform where the user can write comments to a cell (excel sheet). My problem is this: If the user wants to change line in the txtbox by using enter a square emerge at the end of the line in the sheet. Is it possible to remove that square? Is there a vb code that makes it possible to draw in a txtbox (lines, circles etc.) and return the drawing into a cell? -- Nil Satis Nisi Optimum |
2 small problems
Hi Michael,
Here's a copy of an answer I made to someone else with the same problem: <<I suspect this is because the new lines in the textbox are created with a carriage return and line feed (CHR(13) & CHR(10)) whereas the Excel cells just use a line feed (CHR(10)). (Although I can't recreate the problem you experience manually.) You can clean out the CHR13s by using Replace e.g. cells("A1") = replace(cells("A1"),vbcr,"") Replace is only available in Excel 2000 and greater. (You can use athe worksheet function replace if you're running XL97). Note however you don't need to do this if you don't copy text and use code such as: Cells(1, 1) = TextBox3.Text to place the text directly in a cell. With respect to drawing in a text box.... I have never heard of such a control. Off the top of my head, a very poor workaround: You could shell out to pbrush.exe (maybe dictate the filename?). Pop up a msgbox saying "click me when you've finished and saved your drawing" and then load the image up in your userform when they click ok. I also notice something called Microsoft InkPicture control on my toolbox that might do exactly what you're looking for. I've never used it though. HTH, Gareth Michael wrote: Hi. I have a txtbox (with multiline) on a userform where the user can write comments to a cell (excel sheet). My problem is this: If the user wants to change line in the txtbox by using enter a square emerge at the end of the line in the sheet. Is it possible to remove that square? Is there a vb code that makes it possible to draw in a txtbox (lines, circles etc.) and return the drawing into a cell? |
2 small problems
Thank's Gareth
-- Nil Satis Nisi Optimum "Gareth" wrote: Hi Michael, Here's a copy of an answer I made to someone else with the same problem: <<I suspect this is because the new lines in the textbox are created with a carriage return and line feed (CHR(13) & CHR(10)) whereas the Excel cells just use a line feed (CHR(10)). (Although I can't recreate the problem you experience manually.) You can clean out the CHR13s by using Replace e.g. cells("A1") = replace(cells("A1"),vbcr,"") Replace is only available in Excel 2000 and greater. (You can use athe worksheet function replace if you're running XL97). Note however you don't need to do this if you don't copy text and use code such as: Cells(1, 1) = TextBox3.Text to place the text directly in a cell. With respect to drawing in a text box.... I have never heard of such a control. Off the top of my head, a very poor workaround: You could shell out to pbrush.exe (maybe dictate the filename?). Pop up a msgbox saying "click me when you've finished and saved your drawing" and then load the image up in your userform when they click ok. I also notice something called Microsoft InkPicture control on my toolbox that might do exactly what you're looking for. I've never used it though. HTH, Gareth Michael wrote: Hi. I have a txtbox (with multiline) on a userform where the user can write comments to a cell (excel sheet). My problem is this: If the user wants to change line in the txtbox by using enter a square emerge at the end of the line in the sheet. Is it possible to remove that square? Is there a vb code that makes it possible to draw in a txtbox (lines, circles etc.) and return the drawing into a cell? |
All times are GMT +1. The time now is 06:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com