I created a .csv file that looked like this:
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
And this worked ok:
Option Explicit
Sub testme02()
Dim myCell As Range
Dim myRng As Range
With ActiveSheet
Set myRng = Nothing
On Error Resume Next
Set myRng = .Cells.SpecialCells(xlCellTypeConstants, xlTextValues)
On Error GoTo 0
End With
If myRng Is Nothing Then
MsgBox "No text values found"
Exit Sub
End If
For Each myCell In myRng.Cells
With myCell
If Left(.Value, 1) = "'" Then
.NumberFormat = "@"
.Value = Mid(.Value, 2)
End If
End With
Next myCell
End Sub
I created a .csv file that looked like this:
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345
'1234,'1234,'2345,'2345