Hi everyone, I have sheets that sometimes has up to 5k rows. Column E is known to sometimes have duplicates so I have the macro below to look and copy those duplicate cells to sheet2. When I run it I get "No cells were found." and i'm not sure why.
![]()
Option Explicit Sub FilterAndCopy() Dim wstSource As Worksheet, _ wstOutput As Worksheet Dim rngMyData As Range, _ helperRng As Range Set wstSource = Worksheets("Sheet1") Set wstOutput = Worksheets("Sheet2") Application.ScreenUpdating = False With wstSource Set rngMyData = .Range("A1:R" & .Range("E" & .Rows.Count).End(xlUp).Row) End With Set helperRng = rngMyData.Offset(, rngMyData.Columns.Count + 1).Resize(, 1) With helperRng .FormulaR1C1 = "=if(countif(C1,RC1)>1,"""",1)" .Value = .Value .SpecialCells(xlCellTypeBlanks).EntireRow.Copy Destination:=wstOutput.Cells(1, 1) .ClearContents End With Application.ScreenUpdating = True End Sub
Bookmarks