Hi
Does this exist
A text box which you can enter multiple lines of text but have VB notice them as seperate lines of text or text boxes.
1 line one text
2 line two text
etc.
Thanks in advance
Oakey
Printable View
Hi
Does this exist
A text box which you can enter multiple lines of text but have VB notice them as seperate lines of text or text boxes.
1 line one text
2 line two text
etc.
Thanks in advance
Oakey
You will have to dump it into an array...using Split()
Hi
Thanks for that, do you happen to know any code for that.
Thanks verymuch for that.
Oakey
Code:Private Sub Form_Load()
Dim test As String
Dim a() As String
Dim i As Integer
test = "Hello World, It Works"
a = Split(test)
For i = LBound(a) To UBound(a)
MsgBox a(i)
Next
End
End Sub
Code:Private Sub Command1_Click()
'contents of text1
'1 line one text
' 2 line two text
Dim sString As String
Dim sVar
sString = Text1
sVar = Split(sString, vbCrLf)
MsgBox sVar(0) '= 1 line one text
MsgBox sVar(1) '= 2 line two text
End Sub
Hi Lethal
That works great but forgive me i'am very new to VB, and i cant seem to work out how to integrate that code to my program.
All the program does is export text boxes and dumps them into excel to various defined cells, the only problem is that most text boxes are only small with the exception of one, which is not masive.
is it possible to do this
Thanks in advance
Mark
Lethals code is not splitting lines it is splitting words.
Your right HeSaidJoe, I just threw in a few lines of code to show him some of the split functionality. Oakey, use HeSaidJoe's code, the only difference is the vbCrlf. I'm not sure on how to interface with excel, never messed with excel and vb together.