Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Updating a textbox without erasing previous data


Hi all,

I have a multiline textbox...
I've built a loop to write many lines; here is it:

For x = 1 To 5
Worksheets("result").Newdatabox.Text = "here is the text" + Chr(10)

Next x

So as to obtain in the textbox something like:
here is the text
here is the text
here is the text
here is the text
here is the text


However, the problem is that at every loop (1 to 5), it seems that it
erases the previous line! And so the only thing I get is:
here is the text
and that's all!..

How can I use a loop to put text (imported from a range of cell
values...) and update my textbox without erasing previous data?

Thanks a lot for your help!
Cheers.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Updating a textbox without erasing previous data

Of course.
Worksheets("result").Newdatabox.Text = "here is the text"
says "this is your text", not "keep your existing text and add the following". Try instead

Worksheets("result").Newdatabox.Text = _
Worksheets("result").Newdatabox.Text & "here is the text" + Chr(10)

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"nadir" wrote in message
...

Hi all,

I have a multiline textbox...
I've built a loop to write many lines; here is it:

For x = 1 To 5
Worksheets("result").Newdatabox.Text = "here is the text" + Chr(10)

Next x

So as to obtain in the textbox something like:
here is the text
here is the text
here is the text
here is the text
here is the text


However, the problem is that at every loop (1 to 5), it seems that it
erases the previous line! And so the only thing I get is:
here is the text
and that's all!..

How can I use a loop to put text (imported from a range of cell
values...) and update my textbox without erasing previous data?

Thanks a lot for your help!
Cheers.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial

statements


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
Adding text without erasing previous text? Adding Text Without Deleting Excel Discussion (Misc queries) 7 April 2nd 23 08:57 PM
Prevent previous entered data from updating ksell87 Excel Discussion (Misc queries) 1 May 14th 10 12:13 AM
Trendline Textbox Not Updating Phil Hageman Charts and Charting in Excel 5 September 27th 08 05:11 PM
Erasing a Formula? Varan27 Excel Discussion (Misc queries) 2 March 28th 07 01:53 AM
Updating Info from a previous worksheet Tara working away Excel Worksheet Functions 0 August 10th 06 10:18 PM


All times are GMT +1. The time now is 11:34 AM.

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"