jebarri
04-13-2015, 05:08 PM
I am trying to get VBA to print a sheet to a .txt file. I should not that saving as a .txt file created "" around each cell value. The output file is used directly by a spotting robot so the "" cannot be present.
I have 3 columns and multiple (over 5000) rows with some blank. The first row contains array placements (e.g. 1/1, 1/2, 1/3....2/18...all the way to 18/36).
When the macro prints to the .txt file, any array coordinate which can be read as a date is printed as such.
For example, the first lines in the .txt file are
01/01/2015 *probe*, *droplets*,
01/02/2015 *probe*, *droplets*,
01/03/2015 *probe*, *droplets*,
01/04/2015 *probe*, *droplets*,
01/05/2015 *probe*, *droplets*,
01/06/2015
01/07/2015 *probe*, *droplets*,
01/08/2015 *probe*, *droplets*,
How do I request the value of the cell not be converted into a date. I have tried adding in '1/1, etc. but that does not solve the issue.
Thanks so much.
Example of repeated code for printing:
With Sheet1
sLine = Format(Cells(lRow, 1)) & vbTab
sLine = sLine & .Cells(lRow, 2) & vbTab
sLine = sLine & .Cells(lRow, 3) & vbTab
I have 3 columns and multiple (over 5000) rows with some blank. The first row contains array placements (e.g. 1/1, 1/2, 1/3....2/18...all the way to 18/36).
When the macro prints to the .txt file, any array coordinate which can be read as a date is printed as such.
For example, the first lines in the .txt file are
01/01/2015 *probe*, *droplets*,
01/02/2015 *probe*, *droplets*,
01/03/2015 *probe*, *droplets*,
01/04/2015 *probe*, *droplets*,
01/05/2015 *probe*, *droplets*,
01/06/2015
01/07/2015 *probe*, *droplets*,
01/08/2015 *probe*, *droplets*,
How do I request the value of the cell not be converted into a date. I have tried adding in '1/1, etc. but that does not solve the issue.
Thanks so much.
Example of repeated code for printing:
With Sheet1
sLine = Format(Cells(lRow, 1)) & vbTab
sLine = sLine & .Cells(lRow, 2) & vbTab
sLine = sLine & .Cells(lRow, 3) & vbTab