jbesclapez
Active Member
- Joined
- Feb 6, 2010
- Messages
- 275
Hello Mr Excel
Could someone tell me how to write VBA code of filtering data without activating the sheet to delete my rows.
Here is my code below
Could someone please rewrite these lines without the Worksheets("QRU").Activate and also without using ActiveSheet
Thanks for your time
Could someone tell me how to write VBA code of filtering data without activating the sheet to delete my rows.
Here is my code below
Code:
Dim LastRowA As Long
LastRowA = Sheets("QRU").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("QRU").Activate
Sheets("QRU").Range("A1:E" & LastRowA).AutoFilter Field:=1, Criteria1:="=vide"
Sheets("QRU").AutoFilter.Range.Offset(1, 0).Rows.SpecialCells(xlCellTypeVisible).Delete (xlShiftUp)
Sheets("QRU").AutoFilterMode = False
Could someone please rewrite these lines without the Worksheets("QRU").Activate and also without using ActiveSheet
Thanks for your time