Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2nd Line in VBA coding 1

Status
Not open for further replies.

AmritPaulSingh

Programmer
Dec 5, 2002
46
CA
If the VBA code has a very long line, how do i break it in 2 or more lines. I know there is something to do with & _ but am not able to use it.
Thanks
 
The thing you are loking for is

_

space then _ then just keep typing on the next line
 
if you just want to insert a line then you should use
Code:
_
. If you are also concatenating strings etc then use
Code:
& _
(notice the sapce in between).
Code:
public function myFun(param1 as string _
                      param2 as integer) as String
    Dim result as String

    result = param1 & _
             param2

    myFun = result
end function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top