In Excel, how do you split the VBA code for a long Range object?
To simplify my problem, let's say the following Range object is too long:
And I want the code to look like a list:
However, when I move my cursor away from this line of code after hitting the enter key right after the first underscore, such as:
The code turns red, and a message box appears that says, "Compile error: Expected: list separator or )"
How do you make what I am trying to accomplish work? Suggestions?
To simplify my problem, let's say the following Range object is too long:
Code:
Set r1_text = Sheets("1").Range("E8:F17, E21:F70, I21:J70, C73:G87")
And I want the code to look like a list:
Code:
Set r1_text = Sheets("1").Range(" _
E8:F17, _
E21:F70, _
I21:J70, _
C73:G87 _
")
However, when I move my cursor away from this line of code after hitting the enter key right after the first underscore, such as:
Code:
[COLOR=#ff0000]Set r1_text = Sheets("1").Range(" _
E8:F17, E21:F70, I21:J70, C73:G87")[/COLOR]
The code turns red, and a message box appears that says, "Compile error: Expected: list separator or )"
How do you make what I am trying to accomplish work? Suggestions?