Compare/move cells in columns, call from Sweden

Goldmund

New Member
Joined
Mar 14, 2002
Messages
3
Hi,

I wonder if anyone can help me on this one?

I have 3 columns with almost identical
values of this type, "FE10H", in columns
A & B and numeric values in cC . They are however on diffrent rows, but all in the same order in the columns (its from a mimer database). Is there a simple way (code)to compare for ex. "A1" & "B1", and if content in "A1" <> "B1" move content in "B1"& "C1" to the row in column B where "A" = "B". Could this be repeated until column A = cB?

Thanks in advance

/Mat
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Ok but something i am missing: move to row A=B, which row?: the last row has A=B equality just before current row?

Or it could be better if you can show us some data.
 
Upvote 0
Thank you for the reply

This is what I had in mind.
What I need is to match the content in column A with the content in column B (and also move the content in column C with it).
In this example i´d like AR10H (columnB row 2) and 4 (column C row 2) to move down to AR10H (column A)and so on..(just like row 1)
All this until column A=B
A B C
AT13H AT13H 4,33
AT20H AR10H 4
AR10H AS19D x
AR11H AS21D x
AR20H BS10H i.s
AR30H BS20H i.s
AS19D BS25D pg
AS21D BK10H 4,31

See what I mean? I appreciate Your help!

/Mat
 
Upvote 0
I am not sure this is exactly you want but it does like your sample. What about if B1 value doesnot exist in any A column cell? Below code does do nothing in this case.


Private Sub JustDoIt()
Dim i As Integer
Dim j As Integer
i = 1
With ActiveSheet
Do Until .Cells(i, 1) = ""
j = 0
Do Until .Cells(i + j, 1) = .Cells(i, 2)
If .Cells(i + j, 1) = "" Then GoTo fin
j = j + 1
Loop
If Not j = 0 Then
strRange = "B" & Trim(Str(i)) & ":C" & Trim(Str(j + i - 1))
.Range(strRange).Select
Selection.Insert Shift:=xlDown
i = j + i - 1
End If
i = i + 1
Loop
End With
fin:
Range("A1").Select
End Sub

suat
 
Upvote 0
Hello,

What if I have something like this?

A B C D E F
xxx xxxx xxx 123 123
xxx xxxx xxx 123A 123B
xxx xxxx xxx 123B 123C

Is it possible to leave column A, B, C, D untouched and match against column E from column D?

If E matches D then leave in the same row and if E does not match D then move to column F?

Basically, I have a set of transactions from one system which is column D and I have another set of transactions from another system which may or may not have the same transaction from column D. They are all sorted from + to -. I just need to match up cells from column E to column D.

I really appreciate it if you can come up with a macro like that.

Thanks,
Peter
 
Upvote 0

Forum statistics

Threads
1,213,558
Messages
6,114,297
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top