0

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

aSystemOverload
  • 2,854
  • 18
  • 47
  • 70

2 Answers2

4

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
Community
  • 1
  • 1
chris neilsen
  • 50,779
  • 10
  • 82
  • 118
2

Just try this:

Dim r As Range
Set r = Sheets("vwReportA").Rows("15:15")
Range(r, r.End(xlDown)).Clear
Enigmativity
  • 105,241
  • 11
  • 83
  • 163