I believe alignment of identifiers, operators, etc. in my code greatly improves readability. Errors just jump off the screen before I ever compile or run the code. However, the VBA editor removes the extra spaces, destroying my alignment. For example, I am trying to enter several lines as follows:
something = "a" & CStr(iRow1) 'Colm A = Something useful
somethingElse = "b" & CStr(iRow1) 'Colm B = Something else
dunno = "c" & CStr(iRow1) 'Colm C = Don't know what this is
whatEver = "d" & CStr(iRow1) 'Colm D = whatever you want
aVar = "e" & CStr(iRow1) 'Colm E = A variable
xOrY = "f" & CStr(iRow1) 'Colm F = Might be X or Y
aLongVariableName = "g" & CStr(iRow1) 'Colm G = Long variable name
but I get the following:
something = "a" & CStr(iRow1) 'Colm A = Something useful
somethingElse = "b" & CStr(iRow1) 'Colm B = Something else
dunno = "c" & CStr(iRow1) 'Colm C = Don't know what this is
whatEver = "d" & CStr(iRow1) 'Colm D = whatever you want
aVar = "e" & CStr(iRow1) 'Colm E = A variable
xOrY = "f" & CStr(iRow1) 'Colm F = Might be X or Y
aLongVariableName = "f" & CStr(iRow1) 'Colm G = Long variable name
This is much less readable. Even the comments are not aligned. Note how easy it would be to identify jRow among iRow in the first block compared to the second. And did you notice an error in the last line of misaligned code ("f" instead of "g")? Not so easy to notice without alignment.
So, how can I prevent the VBA editor from twisting my alignment by eating extra spaces?