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
Mike PageAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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:
Mike

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
        ar.ClearContents
    Next ar

Open in new window

[/code]
0

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
0
NorieAnalyst Assistant Commented:
Mike

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?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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!!
0
Mike PageAuthor Commented:
Actually move to J if the word contains 'Answer'
0
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
                ar.ClearContents
            End If
        Next cl
    Next ar

Open in new window

0
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
VBA

From novice to tech pro — start learning today.