I've got some unprintable characters when importing a text report generated from a call handling system. I've got some code to clean using an Excel worksheet function:
'lots of gaps between lines...
cRows = Range("A65536".End(xlUp).Row + 1
Range("B1".Select
Do Until ActiveCell.Row = cRows
ActiveCell.FormulaR1C1 = "=CLEAN(RC1)"
ActiveCell.Offset(1, 0).Select
Loop
Columns("B:B".Copy
Range("A1".PasteSpecial Paste:=xlValues
Columns(2).Delete Shift:=xlToLeft
...but it is way slow! The main unprintable culprit I want to remove is (chr 12). I originally tried:
Columns(1).Replace What:=Chr(12), Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
...but it doesn't comply (get error message "Function Not Valid".
Any help greatly appreciated.
'lots of gaps between lines...
cRows = Range("A65536".End(xlUp).Row + 1
Range("B1".Select
Do Until ActiveCell.Row = cRows
ActiveCell.FormulaR1C1 = "=CLEAN(RC1)"
ActiveCell.Offset(1, 0).Select
Loop
Columns("B:B".Copy
Range("A1".PasteSpecial Paste:=xlValues
Columns(2).Delete Shift:=xlToLeft
...but it is way slow! The main unprintable culprit I want to remove is (chr 12). I originally tried:
Columns(1).Replace What:=Chr(12), Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
...but it doesn't comply (get error message "Function Not Valid".
Any help greatly appreciated.