Originally posted by: iDazzler
Hi Hyperlite,
I had the same issue a while back and it has to do with an space ( ASCII Char(160) ) being passed into the cell. What you have to do is format that area to strip out the extra space and then do you manipulation.
Here's the function I had recorded then manipluted but anything similar will work:
Sub SelectCurrentRegionAndFormat()
Dim Col As Range
ActiveCell.CurrentRegion.Select
ActiveCell.CurrentRegion.Name = "LPDATA"
ActiveCell.CurrentRegion.Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
For Each Col In ActiveCell.CurrentRegion.Columns
If Application.CountA(Col) > 0 Then
Col.TextToColumns Destination:=Col(1), DataType:=xlFixedWidth, FieldInfo:=Array(0, 1)
End If
Next Col
End Sub
Bottom line write function to strip out extra ascii character 160 and you're good to go...
Dan