View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Same code, different line

Neil,

Your character is the underscore.
Be aware, it must be at the end of the line, must be after a space and you
there is a limit to the number of "line continuations" you're allowed.

Sub testit()
Dim strMyValue As String

strMyValue = _
"How do you continue the same line of code on a new line? " &
vbNewLine & _
"Basically instead of having one long line where you would" &
vbNewLine & _
"need to scroll horizontally to see the end, you can have" &
vbNewLine & _
"it spread over a number of lines and only scroll" & _
"vertically."

MsgBox strMyValue

End Sub


"Neil" wrote in message
...
How do you continue the same line of code on a new line?
Basically instead of having one long line where you would
need to scroll horizontally to see the end, you can have
it spread over a number of lines and only scroll
vertically.

Thanks for your speedy response.