Search: | |||||

| ||||

Home » Forum » MS Office | RSS Feeds |

How could I accomplish the below scenerio:

I have three columns in the same worksheet:

Column A, Column B, and Column C.

Column A and B contain 15 didget numbers and Column C contains 7

didget number.

Column A contains certain number, and Column B contains certain

number.

Most of the numbers in Column A & B match.

I want to compare Column's B & A and if the numbers don't match,

I want to shift cell in column B and Cdown till it finds a match

in Column A so that Column B matches Column A and also at the same

time move the corresponding value in Column C down with the Column B

that is being moved down.

I would like all of this to be done automatically. using Excel Macro

Try this

paste this macro into the VBA editor

Option Explicit

Sub lineupnumbers()

' Macro by David Grugeon

'

Dim X

Dim Y

X = Selection.Row

Y = Selection.Rows.Count

Y = Y + X - 1

For X = X To Y

If Range("A" & X) <> Range("B" & X) Then

Range(("B" & X), ("C" & X)).Select

Selection.Insert Shift:=xlDown

End If

Next X

End Sub

Then select all the rows with numbers in column A

Then run the macro

1) Do not post the same question twice under different subjects.

2) Do not request fast response - especially without giving a very good

reason for why your question should take priority over other questions (and

over our own priorities in life).

3) You must do the first part of the work. This is not a programming

service. What have you done so far? Post your reasoning and/or your code.

Didn't find what you were looking for?
Find more on How could I accomplish the below scenerio
Or get search suggestion and latest updates.

Related Topics:

- Can I accomplish this with Java?
- convert me this below program first into a new program using the while loop
- Can you solve part of the problem of below question
- Add below, not above
- Selecting the row below
- active cell no longer advances to cell below
- Is there anyone to help me for problem given below
- Implement below algorithms in c++
- How to find grades with the below data using prolog?
- I have some code I need help with. see below