I inherited an excel macro that compares two different worksheets and
matches rows from worksheet 2.
I created a module that would let me know if there are any duplicates
in worksheet 2. The problem is when I run this macro it does not yield
a result but rather shows me the formulas that comprise the macro and
also states something is wrong within my formulas!
Would you have any idea how to actually get my module/macro to evaluate
rather than just pasting the formulas as it is doing now?
(Please note that that worksheet2 is in format text when I run the
below macro)
Any help would be greatly appreciated::
Sub DupeCheck()
'
' DupeCheck Macro
'
'
Application.ScreenUpdating = False
Sheets("Worksheet2").Select
Range("O1").Select
ActiveCell.FormulaR1C1 = "=E1&F1&G1&K1"
Range("P1").Select
ActiveCell.FormulaR1C1 = "=if(countif($O$1:O1,O1)>1,"Dupe","")"
Range("O1").Select
Selection.AutoFill Destination:=Range("O1:O10000"),
Type:=xlFillDefault
Range("O1:O10000").Select
ActiveWindow.SmallScroll ToRight:=2
ActiveWindow.SmallScroll Down:=-27
Range("P1").Select
Selection.AutoFill Destination:=Range("P1:P10000"),
Type:=xlFillDefault
Range("P1:P10000").Select
Range("P10001").Select
ActiveCell.FormulaR1C1 = "=counta(P1:P10000)"
Range("P10001").Select
ActiveWindow.SmallScroll Down:=-15
Sheets("Worksheet1").Select
Range("F14").Select
ActiveCell.FormulaR1C1 = "=IF('Worksheet2'!A1=0,"","Possible Dupes
= &"'Worksheet2'!A1)"
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3
Sheets("Worksheet2").Select
Range("O1:P10001").Select
Selection.ClearContents
Range("A1").Select
ActiveWindow.ScrollColumn = 1
Sheets("Worksheet1").Select
Application.ScreenUpdating = True
End Sub