If you want to delete the mass data in one go . Snapshot below
Here is the code-
Sub find_delte_using_autofilter()
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
Dim Z As Long
On Error Resume Next
' to remove the filtermode if
Sheets(1).AutoFilterMode = False
' to find the last row
Z = Sheets(1).Range("a1").End(xlDown).Row
' change the range , field and criteria as per your requirement
Sheets(1).Range("$A$1:$c" & Z).AutoFilter Field:=2, Criteria1:="del"
' delete the filtered data
Sheets(1).Range("$A$2:$c" & Z).SpecialCells(xlCellTypeVisible).Delete
On Error Resume Next
' remove autofilter
Sheets(1).AutoFilterMode = False
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub
Showing posts with label Find and Delete using Autofilter. Show all posts
Showing posts with label Find and Delete using Autofilter. Show all posts
Saturday, September 17, 2011
Subscribe to:
Posts (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
Macro to Export Range in Json Format Option Explicit Sub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoex...
-
If you want to run SQL queries within Excel environment without connecting to any database, you can do it with creating the ADODB conn...