# Comparing column A with over 8000 lines to 7 other columns

#### Christine Butler

##### New Member
I need to know how to get specific data back. Column A has over 8000 lines
Columns b:h each have over 8000 lines of data. I need to match column
A with the same number (remember there are 8000 different or matching numbers in Column A) with columns b:h for any of the same numbers that may be in Column A. Can anyone help?
Thanks,
Chris

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

#### Oaktree

##### MrExcel MVP
Welcome to the board.

So... what would you like to happen if/when a match is found in, say, column D?

#### Christine Butler

##### New Member
Thanks for trying to help.

All of the results that match would need to be in either some column or just sorted out so I know which ones to remove.

#### Oaktree

##### MrExcel MVP
Still a couple more questions...

Are you removing them from column A or from columns B:H?

Do you just want the cell's contents cleared? Or do you want the data to shift?

#### Christine Butler

##### New Member

Comparing

I need to compare column A to columns b-i. If there is a match from the data in column a anywhere else in the worksheet, I need to delete the match that would be anywhere in columns b-i.
Thanks again,
Chris

#### Oaktree

##### MrExcel MVP
One way is:

Code:
``````For Each cell In Range("B1:I"&Range("I65536").end(xlup).row)
Set my_match = Range("A:A").Find(cell)
If Not my_match Is Nothing Then cell.ClearContents
Next``````

#### Christine Butler

##### New Member

I'll try it.

Dop I enter it exactly as you described?

#### Oaktree

##### MrExcel MVP
More or less... just put it within your sub.

Such as:

Code:
``````Sub my_replace()
Dim cell As Range
For Each cell In Range("B1:I" & Range("I65536").End(xlUp).Row)
Set my_match = Range("A:A").Find(cell)
If Not my_match Is Nothing Then cell.ClearContents
Next
End Sub``````

#### Christine Butler

##### New Member
Thanks

Thanks for trying to help, but I'm obviously not that experienced with Excel.
I will try to play around with it. Thank you again.
Chris

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

### Forum statistics

1,168,120
Messages
5,857,492
Members
431,882
Latest member
saaaaaaaaaaaaaaaaaaaaaa

### 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.

### Which adblocker are you using?

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

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