I'm deleting a selection of rows and columns from a listobject and can successfully delete columns without activating but not rows.
The code is:
With lst '''removes table columns except the first date column to preserve formulas and formatting
.AutoFilter.ShowAllData
.Range.Columns("F:" & colstr).Delete ''''this works on non active sheet
'.DataBodyRange.Columns(3).Resize(, 2).Select
.DataBodyRange.Range(Cells(5, 1), Cells(lst.ListRows.Count, 1)).EntireRow.Delete ''''this only works if I activate the sheet with table on
.ShowTotals = True
End With
Is there a way around activating the sheet first?
Bookmarks