Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, on my form which adds a record to the active sheet, I have a textbox which, if data is entered in it, will create a comment on a particular cell with that data. I have set the textbox to Enterkeybehaviour = true but when I view the comment later, when the enter key has been used, as well as generating a new line, it is also creating an unwanted character shaped like a square at the end of the line. Could someone advise how to get rid of it. Here is my coding so far: If TextBox4.Text < "" Then With ActiveSheet.Cells(Nextrow, 2).AddComment Visible = False Text TextBox4.Text Shape.TextFrame.AutoSize = True End With End If Thanks. -- Blondegirl ------------------------------------------------------------------------ Blondegirl's Profile: http://www.excelforum.com/member.php...o&userid=29615 View this thread: http://www.excelforum.com/showthread...hreadid=540209 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
does this help? If TextBox4.Text < "" Then With ActiveSheet.Cells(Nextrow, 2).AddComment ..Visible = False if instr(,textbox4.value,chr(13))<0 then ..text worsheetfunction.substitute(textbox4.value,chr(13) ,"") else ..Text TextBox4.Text end if ..Shape.TextFrame.AutoSize = True End With End If Regards, Ivan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
An easier way:
If TextBox4.Text < "" Then With ActiveSheet.Cells(Nextrow, 2).AddComment ..Visible = False ..Text Replace(TextBox4.Text, Chr(13), "") ..Shape.TextFrame.AutoSize = True End With End If -- - K Dales "Ivan Raiminius" wrote: Hi, does this help? If TextBox4.Text < "" Then With ActiveSheet.Cells(Nextrow, 2).AddComment ..Visible = False if instr(,textbox4.value,chr(13))<0 then ..text worsheetfunction.substitute(textbox4.value,chr(13) ,"") else ..Text TextBox4.Text end if ..Shape.TextFrame.AutoSize = True End With End If Regards, Ivan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Brilliant! Thanks a lot for your help, it works a treat. :) -- Blondegirl ------------------------------------------------------------------------ Blondegirl's Profile: http://www.excelforum.com/member.php...o&userid=29615 View this thread: http://www.excelforum.com/showthread...hreadid=540209 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Removing unwanted fonts | Excel Discussion (Misc queries) | |||
Removing unwanted digits | Excel Discussion (Misc queries) | |||
Removing unwanted characters | Excel Discussion (Misc queries) | |||
Unwanted character | Excel Worksheet Functions | |||
Unwanted character | Excel Worksheet Functions |