jski21
Board Regular
- Joined
- Jan 2, 2019
- Messages
- 155
- Office Version
- 2016
- Platform
- Windows
Good day all,
Trying to delete only visible rows in a table once I've filtered out unnecessary data. Using this code but keep getting a "Delete method of Range class failed" error at the Selection.EntireRow.Delete command. Tried a few logical (to me anyway) changes but to no avail:
'Clear unwanted rows
With Sheets("Trial Balance by SubFund").ListObjects("TrialBal")
Intersect(.DataBodyRange.SpecialCells(xlVisible), .Parent.Range("A:O")).Select
Selection.EntireRow.Delete
End With
Any guidance would be appreciated. Thanks.
jski
Trying to delete only visible rows in a table once I've filtered out unnecessary data. Using this code but keep getting a "Delete method of Range class failed" error at the Selection.EntireRow.Delete command. Tried a few logical (to me anyway) changes but to no avail:
'Clear unwanted rows
With Sheets("Trial Balance by SubFund").ListObjects("TrialBal")
Intersect(.DataBodyRange.SpecialCells(xlVisible), .Parent.Range("A:O")).Select
Selection.EntireRow.Delete
End With
Any guidance would be appreciated. Thanks.
jski