Dynamic based on criterias, Delete Excel Table with Selection.ListObject.ListRows(x).Delete

radian89

Board Regular
Joined
Nov 12, 2015
Messages
110
Hi All,

I need some help, I can manage to delete rows dynamically.. but idk on how to delete table dynamically based on criterias with Selection.ListObject.ListRows(x).Delete command

example below, how to delete "Bread" - type only using VBA?




thanks for the help guys!
much appreciate
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

radian89

Board Regular
Joined
Nov 12, 2015
Messages
110
Hi all,

solved!

Code:
Dim i As IntegerDim Tbl As ListObject


Set Tbl = Sheets("Sheet1").ListObjects("Foodie")


Tbl.Range.Rows("5:7").Delete

or you can make it dynamic as referring it to name range


Code:
Tbl.Range.Rows(Range("RangeDelete").Value).Delete
 

Watch MrExcel Video

Forum statistics

Threads
1,109,006
Messages
5,526,243
Members
409,689
Latest member
martin_br

This Week's Hot Topics

Top