Need to move part of a text string to another column in Excel

I have a spreadsheet with this value in A1.  This is the actual text in A1:  

     Active/Inactive                <-- Active/Inactive

What I need to do is move the "<-- Active/Inactive" to column B1 and leave "Active/Inactive" in column A1.

I have a list of 50 values and all of the values that need to move to column B are prefaced with this string: "<-- "
impala6Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

YamaafgCommented:
One way to do it is to use "Text to Columns"

Steps:

1. Select your data
2. Go to "Data" tab
3. Select "Text to Columns"
4. Choose "Fixed width"
5. Click next
6. Move the Arrow where you want to split your data
7. Click Next
8. Choose destination cell to be pasted
9. Click finish.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rgonzo1971Commented:
Hi,

pls try
Sub macro()
For Each c In Range(Range("A1"), Range("A" & Cells.Rows.Count).End(xlUp))
    Pos = InStr(1, c, "<--")
    If Pos > 0 Then
        c.Offset(0, 1) = Trim(Mid(c, Pos))
        c.Value = Trim(WorksheetFunction.Clean(Left(c, Pos - 1)))
    End If
Next
End Sub

Open in new window

Regards
impala6Author Commented:
Thanks for the quick response!  This worked perfectly!
Professor JMicrosoft Excel ExpertCommented:
try this macro

Sub Test()
'

    Columns("A:A").Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
        FieldInfo:=Array(Array(0, 1), Array(22, 1), Array(50, 1)), TrailingMinusNumbers _
        :=True
   Columns("A:B").Select
   Dim cell As Range
Dim rng As Range


  If Selection.Cells.Count = 1 Then
    Set rng = Selection
  Else
    Set rng = Selection.SpecialCells(xlCellTypeConstants)
  End If


  For Each cell In rng.Cells
    cell.Value = Application.WorksheetFunction.Clean(Trim(cell.Value))
  Next cell
End Sub

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.