Hello
I have a script that writes out a file based on data in the spreadsheet. I use the 'write' function as follows:
When I open the resulting file in Notepad++ & turn on hidden characters, I see that there is indeed an LF character where I expect one. Perfect!
Now instead of a file, I want to write everything to a string variable, & save it in a random cell. I create a new sub addLine(), which appends the input string to string variable 'fileString' which is global to the module.
Then I simply replace every instance of "adf.Write (" with "addLine (":
I copy the resulting string from the cell I saved it to and paste it into Notepad++. It looks exactly like the file I wrote earlier, EXCEPT that in place of just an LF character where I expect it, I now get a CR character proceeding the LF character.
I have tried char(10) instead of vbLF which makes no difference. If I omit the '& vbLf' I get no LF or CR (as I would expect). So in the context of strings, a vbLf seems to have exactly the same effect as a vbCrLf. Very inconsistent.
I already don't have that much hair, so any suggestions would be greatly appreciated!
Thanks in advance!
Bookmarks