D
DR
The Code below works to clean non-printing chars on the activesheet.
DR - 4GUnwired.com
'Macro to Clean special characters out of Excel Spreadsheets
Option Explicit
Public Sub CleanBeforeExportToText()
Dim NumRows As Long
Dim NumCols As Long
Dim i As Long
Dim j As Long
Dim strCell As String
Dim c As Range
ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate
NumRows = ActiveCell.Row
NumCols = ActiveCell.Column
For i = 1 To NumCols
For j = 1 To NumRows
'Cells(j, i).Activate 'Comment this out for speed
Set c = Cells(j, i)
strCell = Cells(j, i).Value
c.Value = Application.WorksheetFunction.Clean(strCell)
Next
Next
End Sub
DR - 4GUnwired.com
'Macro to Clean special characters out of Excel Spreadsheets
Option Explicit
Public Sub CleanBeforeExportToText()
Dim NumRows As Long
Dim NumCols As Long
Dim i As Long
Dim j As Long
Dim strCell As String
Dim c As Range
ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate
NumRows = ActiveCell.Row
NumCols = ActiveCell.Column
For i = 1 To NumCols
For j = 1 To NumRows
'Cells(j, i).Activate 'Comment this out for speed
Set c = Cells(j, i)
strCell = Cells(j, i).Value
c.Value = Application.WorksheetFunction.Clean(strCell)
Next
Next
End Sub