Macro - trailing blanks

  • Thread starter Dennis Griffith
  • Start date
D

Dennis Griffith

I am trying to write concatenated individual cells as a record to a
file but it is trimming the trailing blanks in the cell. This is the
code I have:

For RowNdx = StartRow To EndRow
WholeLine = ""
For ColNdx = StartCol To EndCol
CellValue = (Cells(RowNdx, ColNdx).Value)
WholeLine = WholeLine & CellValue
Next ColNdx
Print #FNum, WholeLine
Next RowNdx

If cell1 = "Test " and cell2 = "This ". The result in the file is a
record with "TestThis". How can I get it to write the record as
"Test This"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top