Sub capSplit()
firstRow = 2
col = "A"
For Each cel In Range(Cells(firstRow, col), Cells(Rows.Count, col).End(xlUp)).Cells
n = cel.Value
i = 1
Do
i = i + 1
c = Asc(Mid(n, i, 1))
Loop Until i = Len(n) Or (c < 91 And c > 64)
If i < Len(n) Then
cel.Offset(, 1) = Trim(Left(n, i - 1))
cel.Offset(, 2) = Trim(Mid(n, i, Len(n)))
End If
Next
End Sub
Excel Workbook | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | John Violet | John | Violet | ||
2 | Mary jr Dsouza | Mary jr | Dsouza | ||
3 | B n Chandra | B n | Chandra | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C1 | =REPLACE(A1,1,LEN(B1),"") |