Script/Formula to move data to another cell

Hi Experts,

See attached.

How do I

1) Move all numeric values in cell 'H' to the adjecent cell 'I' (same row)
2) Clear the cell 'H' after step 1 is completed
3) Move text with 'Answer' to the cell J (same row)
4) Clear the cell after the move

is this possible? new to intense VBA !!

Kind Regards

Mike PageAsked:
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.

NorieAnalyst Assistant Commented:

There's no attachment I'm afraid.

For the first part you could try this.
Dim Ar As Range

    For Each ar In Range("H:H").SpecialCells(xlCellTypeConstants, 1)
        ar.Offset(,1).Value = ar.Value
    Next ar

Open in new window


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
Mike PageAuthor Commented:
cool first part works
NorieAnalyst Assistant Commented:

I didn't post anything for the 2nd part as, to me anyway, it isn't clear what you want to do - kind of hoped the attachent would have helped.:)

Anyway, is it that you want to find 'Answer' in column H and if found move it to column J?
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

Mike PageAuthor Commented:
Anyway, is it that you want to find 'Answer' in column H and if found move it to column J?

Yes please..

Sorry about the attached thing.. internet is down at the office now using smart in the meantime!!
Mike PageAuthor Commented:
Actually move to J if the word contains 'Answer'
NorieAnalyst Assistant Commented:
We can use similar code for that but we since we are looking for a specific value, ie 'Answer', we need another loop.
Dim ar As Range
Dim cl As Range

    For Each ar In Range("H:H").SpecialCells(xlCellTypeConstants, 2)
        For Each cl In ar.Cells
            If ar.Value = "Answer" Then
                ar.Offset(, 2).Value = ar.Value
            End If
        Next cl
    Next ar

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

From novice to tech pro — start learning today.