text box in user form

Steve001

Board Regular
Joined
Apr 13, 2017
Messages
62
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hi

Is it possible to insert a text string in a certain position each and every time ?

I have a text box that has 13 lines

ie

string 1 - always goes on line 1
string 2 - always goes on line 2
string 3 - always goes on line 3

etc

not got a clue if someone can help

PS please put comments in the code still a noob

Thanks

Steve
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hello

After each string you need vbNewLine appended to the end of the line for example

TextBox1.Value = String1 & vbNewLine & String2 & vbNewLine & String3........and so on

give it a try
 
Upvote 0
Hi Nine Zero

Thanks didn't know you could do that approach

Thought you had to move the cursor then print on that line.

Will give it a go

Steve
 
Upvote 0
hi

That approach not working unless I am doing something wrong - they are all on the same line and I have word like "paragraph" markings in my message box at the end of each sring?

Steve
 
Last edited:
Upvote 0
Ahh yes i forgot to mention you must set the textbox to allow multiple lines so you need to add this line of code before the one i posted earlier

TextBox1.MultiLine = True

That should fix it
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,637
Members
449,461
Latest member
kokoanutt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top