View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Fiona[_4_] Fiona[_4_] is offline
external usenet poster
 
Posts: 9
Default Enter key text symbol

Thanks Dianne,

Well that looks easy :o),
I didn't even know there was an "Application.WorksheetFunction.Substitute"

Makes you wonder how many ways it may be possible to do the same ?


"Dianne" wrote in message ...
Private Sub CmdOK_Click()
Dim strText As String
strText = TxtNotes.Text
strText = Application.WorksheetFunction.Substitute(strText, vbCr,
"")
ActiveSheet.Range("Notes") = strText
Unload Me
End Sub

--
HTH,
Dianne

In om,
Fiona typed:
I have a form with a multiline textbox which has (EnterKeyBehavior
=True) property.

When the ok button is clicked on the form, the contents of the textbox
is placed into a range on a worksheet. Problem is the ascii symbol for
the enter key, it is displayed at the end of every line.

Is there anything I can do to stop this ?

Private Sub CmdOK_Click()
ActiveSheet.Range("Notes") = TxtNotes.Text

Unload Me
End Sub