I have this function, written from another post, except I am running into an issue where my messages need to be wordy so the end user doesn’t panic, that being said, how do I break a sentence below so it will be readable while I am coding?
I hope this makes sense… thanks.
Function GetErrMsg(ErNo As Long) As String
Select Case ErNo
Case 91
GetErrMsg = "This is a long message that needs to be broken into sections so it can be read normally in the programming box"
End Select
End Function
You can use the Underscore
_to break up lines of code like this:Note
When breaking up strings you need to end the string with a
"Then add the ampersand
&to concatenate before the underscore_like in the above example.This tells VBA that the string is over, but will be joined to the string on the next line.