-
Turns out that I can use the Split function after all, as the space width wasn't an issue as I thought it would be.
Sorry if I wasted anyones time
[vba]
Public Sub Process_PN_String()
Dim strArr() As String
Dim MyStr As String
Dim LastRow As Long
Dim rng As Range
Dim cell As Range
Application.ScreenUpdating = False
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Set rng = .Range(.Cells(1, 1), .Cells(LastRow, 1))
For Each cell In rng
MyStr = Trim(cell.Value)
strArr = Split(MyStr, Space(1))
On Error Resume Next ' to avoid error if row is empty
cell.Offset(0, 1).Value = Trim(strArr(0))
Next cell
End With
Application.ScreenUpdating = True
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules