I have the following simple line to print a new line to a log file:
Print #fileNumber, vbNewLine
However, this results in 2 newlines instead of one. My code does not have any other vbNewLines or anything that would print newlines.
If I do not have this print line, then I print no newlines, so this means this line is printing 2 newlines.
Does anyone have any ideas why?
Just tested this, and Print always adds a linebreak.
So simply using Print #fileNumber,
will result in 1 blank line.
The problem is that Print already prints on a new line, so when you add vbnewline
you’re getting 2 lines.
Tags: excel-vbaexcel, file, printing, vba