View Single Post
 
Old 03-31-2018, 02:03 PM
rsrasc rsrasc is offline Windows 10 Office 2013
Competent Performer
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Quote:
Originally Posted by NoSparks View Post
You're not telling us where your data starts in column A, if there are blank cells in column A, nor if these are the only letters possible.
It's hard to beat an actual spreadsheet for showing typical data and its layout.

That being said, based on what you've illustrated, maybe this...
Code:
Sub MoveData()
Dim cl As Range, ray As Variant
For Each cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
    ray = Split(cl.Value, " ")
    cl.Offset(-1, 1).Value = ray(0)
    cl.Offset(-1, 2).Value = ray(1)
    cl.ClearContents
Next cl
End Sub


Hi NoSparks

The data starts in cell A2 and goes all the way to cell A655. There are no blanks in Column A, and the three letters I mentioned before are the only choices or options available.

The macro is giving me Run-time error "9": Subscripts out of range.

Here is a sample of how the information looks like in Column A starting in A2.

Of course, I changed the names.

JOHN SMITH1
XXX-XX-2953-0 REG-PT
JOHN SMITH2
XXX-XX-0184-0 REG-PT
JOHN SMITH3
XXX-XX-3676-0 REG-FT
JOHN SMITH4
XXX-XX-1956-0 REG-FT
JOHN SMITH5
XXX-XX-0441-0 REG-PT
JOHN SMITH5
XXX-XX-5914-0 REG-PT
JOHN SMITH5
XXX-XX-9658-0 FRS


Hoping this will help!

Thanks again for your support.

rsrasc
Reply With Quote