how to delete cell content in excel vba code example
Example 1: delete rows in excel vba code
Sub DeleteRowswithSpecificValue()
For i = Selection.Rows.Count To 1 Step -1
If Cells(i, 2).Value = "Printer" Then
Cells(i, 2).EntireRow.Delete
End If
Next i
End Sub
Example 2: vba excel delete column
' Deletes 3rd column
ThisWorkbook.Worksheets(1).Columns(3).EntireColumn.Delete
' Deletes 3rd column of a range
Range("My_RANGE").Columns(3).EntireColumn.Delete