Reputation: 3084
I want to remove records from a WorkSheet that is hidden and do not want to un-hide it to do so.
If it was visible, I would:
Sheets("vwReportA").Select
Rows("15:15").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Clear
How can I achieve this whilst worksheet is hidden
Upvotes: 0
Views: 945
Reputation: 117064
Just try this:
Dim r As Range
Set r = Sheets("vwReportA").Rows("15:15")
Range(r, r.End(xlDown)).Clear
Upvotes: 2
Reputation: 53126
Using Select
like this is not necassary. See this answer for ideas on avoiding Select
Try this
Dim sh as WorkSheet
Dim rng as Range
Set sh = Sheets("vwReportA")
Set rng = sh.[A15]
sh.Range(rng, rng.End(xlDown)).EntireRow.Clear
Upvotes: 4