ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to tell spaces between values in saved text file from theorig (https://www.excelbanter.com/excel-programming/404390-re-how-tell-spaces-between-values-saved-text-file-theorig.html)

[email protected]

How to tell spaces between values in saved text file from theorig
 
Thanks a lot, but it doesn't seem to answer my original question:
given the excel file,
how do I know the number of spaces between any two neighboring values
in the saved text file (space delimited)?

I ask this because originally the text file is created in the
following way:

1. autofit all columns in the xls file
2. make all columns wider by same magnitude in the code:
Columns(iCols).ColumnWidth = Columns(iCols).ColumnWidth + iColFit
3. create the text file in the code:
Activeworkbook Saveas ... Format:=xlTextPrinter

As i have many files to save, i want to use low lever file I/O to
create the text file using commands such as
"CreateTextFile" and "WriteLine". But the problem is i want to make
sure the text files created in the old way and new way
are exactly the same. As i need to specify the number of spaces
between neighboring values in the new way, this goes back
to my original question: how do i know the number of spaces between
values in the text file given the xls file? (the number could
depend on the contents of cells in the xls file, as autofit is used in
the old way)

Thanks.



All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com