Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Enter key text symbol

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Enter key text symbol

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Enter key text symbol

Fiona,

Application.WorksheetFunction allows you to access a number of the
functions that you use in your Excel worksheets, like VLOOKUP or
SUBSTITUTE. Sometimes the worksheet function is all you need. For a list
of the worksheet functions you can use in VBA, check VBA help.

The fun thing about this newsgroup is that you find lots of different
ways to do the same thing! I find myself frequently jolted out of my VBA
complacency -- "What? You can do that with one line of code instead of
20? Arrghhh!" <g I've learned a lot here.

--
Dianne

In om,
Fiona typed:
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you enter a tick symbol into a spreadsheet cell please? Armitage Shanks Excel Worksheet Functions 4 September 24th 07 07:15 PM
How to enter Naira currency symbol Sivanandam Senthil Velu Excel Discussion (Misc queries) 2 July 7th 06 04:04 PM
how do I enter a square feet symbol in excel? summerlane New Users to Excel 4 September 16th 05 01:56 PM
How do I create a new symbol to enter as a character? Coryne17 Excel Worksheet Functions 4 April 20th 05 05:48 PM
How do I enter a symbol in a footerl? EmmaA Excel Discussion (Misc queries) 4 February 24th 05 01:43 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"