Comparing column A with over 8000 lines to 7 other columns

Christine Butler

New Member
Joined
Dec 9, 2005
Messages
15
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,053
Office Version
  1. 365
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
Joined
Dec 9, 2005
Messages
15
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
Joined
Jun 20, 2002
Messages
8,053
Office Version
  1. 365
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
Joined
Dec 9, 2005
Messages
15
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
Joined
Jun 20, 2002
Messages
8,053
Office Version
  1. 365
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
Joined
Dec 9, 2005
Messages
15
I'll try it.

Dop I enter it exactly as you described?
 

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,053
Office Version
  1. 365
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
Joined
Dec 9, 2005
Messages
15
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
 

Forum statistics

Threads
1,171,139
Messages
5,874,002
Members
433,016
Latest member
LorenzAsurza

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
Top