I am running this code from sheet2 and want to delete
the rows with "dupe" in column 4. in sheet3. I can delete the rows
if I am in sheet 3, but not if I run the code from sheet 2.
Thanks Carroll
Private Sub CommandButton1_Click()
Dim lrow As Long
Workbooks("excel formulas.xlsm").Sheets("sheet3").Select
lrow = 7
With Worksheets("sheet3")
For iCntr = lrow To 3 Step -1
If Cells(iCntr, 4) = "dupe" Then
Rows(iCntr).Delete
End If
Next
End With
End Sub