Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 VBA 中是否可以从 Excel ListObject 表中删除所有符合条件的行?我正在寻找类似于 SQL 语句的东西:
DELETE FROM MyListObjectTable WHERE MyColumn='Some Condition'
尝试这个:
.- 断开连接,
.-ListObject根据条件对条件进行排序(可选只是将条件的结果放在一个Range.Area中以供删除),
ListObject
Range.Area
.-AutoFilter根据ListObject条件,
AutoFilter
.- 删除可见行ListObject.DataBodyRange
ListObject.DataBodyRange
。- 清除AutoFilter