When I put this VERY long line for a message box in VBA, it compiles fine:
If MsgBox("NOTE: If the cursor is in a cell where the line will be deleted, the cursor will be positioned around row 500 after the macro finishes. You can click OK and manually scroll up after the macros completes or click Cancel to reposition the cursor and restart this macro." & Chr(10) & Chr(10) & "Click " & Chr(34) & "Cancel" & Chr(34) & " to skip the macro and reposition the cursor manually before restarting the macro" & Chr(10) & "Click " & Chr(34) & "OK" & Chr(34) & " to proceed with macro execution and scroll up after the macro completes.", vbOKCancel + vbExclamation + vbApplicationModal, "INFORMATION") = vbCancel Then Exit Sub
But when I shorten it up using the _ character to indicate the line continues, like this:
If MsgBox("NOTE: If the cursor is in a cell where the line will be deleted, the cursor will be positioned " _
"around row 500 after the macro finishes. You can click OK and manually scroll up after the macros " _
"completes or click Cancel to reposition the cursor and restart this macro." & Chr(10) & Chr(10) & _
"Click " & Chr(34) & "Cancel" & Chr(34) & " to skip the macro and reposition the " _
"cursor manually before restarting the macro" & Chr(10) & "Click " & Chr(34) + _
& "OK" & Chr(34) & " to proceed with macro execution and scroll up after the macro completes.", _
vbOKCancel + vbExclamation + vbApplicationModal, "INFORMATION") = vbCancel Then Exit Sub
I get this compile error, "Expected: list separator or )"
What am I doing wrong???
If MsgBox("NOTE: If the cursor is in a cell where the line will be deleted, the cursor will be positioned around row 500 after the macro finishes. You can click OK and manually scroll up after the macros completes or click Cancel to reposition the cursor and restart this macro." & Chr(10) & Chr(10) & "Click " & Chr(34) & "Cancel" & Chr(34) & " to skip the macro and reposition the cursor manually before restarting the macro" & Chr(10) & "Click " & Chr(34) & "OK" & Chr(34) & " to proceed with macro execution and scroll up after the macro completes.", vbOKCancel + vbExclamation + vbApplicationModal, "INFORMATION") = vbCancel Then Exit Sub
But when I shorten it up using the _ character to indicate the line continues, like this:
If MsgBox("NOTE: If the cursor is in a cell where the line will be deleted, the cursor will be positioned " _
"around row 500 after the macro finishes. You can click OK and manually scroll up after the macros " _
"completes or click Cancel to reposition the cursor and restart this macro." & Chr(10) & Chr(10) & _
"Click " & Chr(34) & "Cancel" & Chr(34) & " to skip the macro and reposition the " _
"cursor manually before restarting the macro" & Chr(10) & "Click " & Chr(34) + _
& "OK" & Chr(34) & " to proceed with macro execution and scroll up after the macro completes.", _
vbOKCancel + vbExclamation + vbApplicationModal, "INFORMATION") = vbCancel Then Exit Sub
I get this compile error, "Expected: list separator or )"
What am I doing wrong???
Last edited: