As the title says!
I have 30000+ records in column a, and over 60000 in column b in column c there is data that is linked with the value of column b.
Is there anyway to search each instance of a, if it appears in b, display b and c
This is driving me insane
Excel 2010
What does 'display b and c mean'? Delete any that do not match, copy them to another sheet? What?
Im sorry, copy them to a new sheet would be the ideal goal.
Try this
Sub CopyMatches() Dim rng As Range Dim lastrow As Long Application.ScreenUpdating = False With ActiveSheet .Copy After:=.Parent.Worksheets(.Parent.Worksheets.Count) End With With ActiveSheet .Columns("C:C").Insert .Range("C1").Value = "temp" lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("C2").Resize(lastrow - 1).FormulaR1C1 = "=RC[-2]=RC[-1]" Set rng = Range("C1").Resize(lastrow) rng.AutoFilter Field:=1, Criteria1:="FALSE" Set rng = rng.Offset(1) On Error Resume Next Set rng = rng.SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then rng.EntireRow.Delete .Columns("C:C").Delete Shift:=xlToLeft End With Set rng = Nothing Application.ScreenUpdating = True End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks