PC Review


Reply
Thread Tools Rate Thread

'?' displayed in excel: when I hit enter for a new line in textbox

 
 
sam
Guest
Posts: n/a
 
      31st Jul 2009
I have a textbox which accepts large amout of text. So I set the
'EnterKeyBehaviour' property to True, as users can hit enter for a new line.

Once I Set EnterKeyBehaviour property to True, The cell in excel where this
textbox value is stored displays a '?' where ever I hit enter.

For eg:
If in userform text box I entered:
one two three four
five six seven

the excel output displays:
one two three four?
five six seven?

These question marks are displayed where ever I hit enter for a new line in
the textbox.

I hope I made it clear

Thanks in advance
 
Reply With Quote
 
 
 
 
john
Guest
Posts: n/a
 
      31st Jul 2009
sounds like you are showing the carriage return.

Try this approach and see if solves problem:

Range("A1").Value = Application.Substitute(TextBox1, Chr(13), "")
--
jb


"sam" wrote:

> I have a textbox which accepts large amout of text. So I set the
> 'EnterKeyBehaviour' property to True, as users can hit enter for a new line.
>
> Once I Set EnterKeyBehaviour property to True, The cell in excel where this
> textbox value is stored displays a '?' where ever I hit enter.
>
> For eg:
> If in userform text box I entered:
> one two three four
> five six seven
>
> the excel output displays:
> one two three four?
> five six seven?
>
> These question marks are displayed where ever I hit enter for a new line in
> the textbox.
>
> I hope I made it clear
>
> Thanks in advance

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      31st Jul 2009
That enter key is two characters line feed and carriage control.

So fix the string before you plop the value into the cell.

Worksheets("sheet9999").range("A1").value _
application.replace(me.textbox, vbcr, "")

The linefeeds are the alt-0101 (char(10)'s) and you'll want to keep them.

sam wrote:
>
> I have a textbox which accepts large amout of text. So I set the
> 'EnterKeyBehaviour' property to True, as users can hit enter for a new line.
>
> Once I Set EnterKeyBehaviour property to True, The cell in excel where this
> textbox value is stored displays a '?' where ever I hit enter.
>
> For eg:
> If in userform text box I entered:
> one two three four
> five six seven
>
> the excel output displays:
> one two three four?
> five six seven?
>
> These question marks are displayed where ever I hit enter for a new line in
> the textbox.
>
> I hope I made it clear
>
> Thanks in advance


--

Dave Peterson
 
Reply With Quote
 
sam
Guest
Posts: n/a
 
      3rd Aug 2009
Thans a lot john, This worked out great

"john" wrote:

> sounds like you are showing the carriage return.
>
> Try this approach and see if solves problem:
>
> Range("A1").Value = Application.Substitute(TextBox1, Chr(13), "")
> --
> jb
>
>
> "sam" wrote:
>
> > I have a textbox which accepts large amout of text. So I set the
> > 'EnterKeyBehaviour' property to True, as users can hit enter for a new line.
> >
> > Once I Set EnterKeyBehaviour property to True, The cell in excel where this
> > textbox value is stored displays a '?' where ever I hit enter.
> >
> > For eg:
> > If in userform text box I entered:
> > one two three four
> > five six seven
> >
> > the excel output displays:
> > one two three four?
> > five six seven?
> >
> > These question marks are displayed where ever I hit enter for a new line in
> > the textbox.
> >
> > I hope I made it clear
> >
> > Thanks in advance

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      3rd Aug 2009
There are a bunch of typos in this message:

Worksheets("sheet9999").range("A1").value _
= replace(me.textbox1.value, vbcr, "")

The linefeeds are the alt-0010 (char(10)'s) and you'll want to keep them.

If you're using or supporting xl97, you can use:

Worksheets("sheet9999").range("A1").value _
= application.substitute(me.textbox1.value, vbcr, "")



Dave Peterson wrote:
>
> That enter key is two characters line feed and carriage control.
>
> So fix the string before you plop the value into the cell.
>
> Worksheets("sheet9999").range("A1").value _
> application.replace(me.textbox, vbcr, "")
>
> The linefeeds are the alt-0101 (char(10)'s) and you'll want to keep them.
>
> sam wrote:
> >
> > I have a textbox which accepts large amout of text. So I set the
> > 'EnterKeyBehaviour' property to True, as users can hit enter for a new line.
> >
> > Once I Set EnterKeyBehaviour property to True, The cell in excel where this
> > textbox value is stored displays a '?' where ever I hit enter.
> >
> > For eg:
> > If in userform text box I entered:
> > one two three four
> > five six seven
> >
> > the excel output displays:
> > one two three four?
> > five six seven?
> >
> > These question marks are displayed where ever I hit enter for a new line in
> > the textbox.
> >
> > I hope I made it clear
> >
> > Thanks in advance

>
> --
>
> Dave Peterson


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
userform textbox: hit enter to start writing in a new line sam Microsoft Excel Programming 4 3rd Aug 2009 03:46 PM
Can you Click the "Enter" key to go to the next line in a Textbox without Exiting the Textbox ? Corey Microsoft Excel Programming 1 22nd Feb 2007 05:09 AM
When I press Enter can I make my TextBox go to the next line? Jamie Loren Microsoft Access 2 24th Apr 2006 10:06 PM
how do you use vba to place an new line (enter) in a textbox =?Utf-8?B?TWlsbGlzYSBFdWJhbmtz?= Microsoft Access 1 9th Mar 2005 05:25 PM
Can i check user press the <enter> key in multi-line textbox? Chad Z. Hower aka Kudzu Microsoft ASP .NET 1 23rd Jan 2004 11:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:18 AM.