Hi Ted,
Having 90+columns will cause a problem if you use formulae, because you'll run up against the formula-length limit much sooner than that.
Here's some code you can use instead:
Sub TextFileExport()
'The next row tells Excel where to save the output. Modify as needed, keeping the trailing backslash.
Const FilePath = "C:\"
Dim WkSht As Worksheet, ff As Integer
Dim CurrentRow As Long, CurrentCol As Long
Dim MaxRow As Long, MaxCol As Long
Dim strOutput As String
'Loop through all worksheets.
For Each WkSht In ActiveWorkbook.Worksheets
ff = FreeFile
'Open a text file using the current worksheet’s name in the nominated path.
Open FilePath & WkSht.Name & ".txt" For Output As #ff
MaxRow = WkSht.Range("A65536").End(xlUp).Row
MaxCol = WkSht.Range("IV1").End(xlToLeft).Column
'The next line determines the start & end rows. If using the row 1 to hold the column widths, start at row 2.
For CurrentRow = 1 To MaxRow
strOutput = ""
'The next line determines the start & end columns.
For CurrentCol = 1 To MaxCol
'The next line uses the value in row 1 to determine column widths.
' strOutput = strOutput & Left(WkSht.Cells(CurrentRow, CurrentCol) & Space(255), WkSht.Cells(1, CurrentCol))
'The next line uses the text width in row 1 to determine column widths, and adds a space between them.
'Delete the ‘1+’ if the extra space isn’t needed
'strOutput = strOutput & Left(WkSht.Cells(CurrentRow, CurrentCol) & Space(255), 1 + Len(WkSht.Cells(1, CurrentCol)))
Next CurrentCol
'Write the line to the file.
Print #ff, strOutput
Next CurrentRow
'Close the file.
Close #ff
Next WkSht
Set WkSht = Nothing
End Sub
The above code, which I picked up elsewhere and modified, pads out the charatcers to the pre-defined column widths and truncates any that are longer than the limit. Apart from avoiding formula lentgth limits, the other advantage of this approach is that it also avoids Excel's cell-character limit.
If you want to right-align some values, as suggested by JerryKlmns, it would only take a minor tweak to the code and worksheet(s) to support this.
Cheers