0

I have this excel spreadsheet where my macro runs and ends on a certain cell in A column. What my macro is supposed to do from there is delete starting from that specific row I landed on all the way down to row 73.

I have tried a few different things but I have had no luck so far.

Step by step (Example):

  1. Macro starts [macro code] and ends on cell A23 (A23 is a relative reference and will therefore not always be A23)
  2. The code starts deleting rows starting from the row of the ActiveCell
  3. The code stops deleting when he reaches row 73 (73 included in the deleting process.Note that the 73 will never change and is not relative)

Something I tried but it didn't seem to work.

Sub RowDel()
  ActiveCell.Range("ActiveCell.Adress:A73").Select
  Selection.EntireRow.Delete
End Sub
braX
  • 11,506
  • 5
  • 20
  • 33
Cruxer
  • 21
  • 6
  • 1
    You might want to include more of your code... in any case, probably better to [avoid using `Select`](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba). Also avoid using `ActiveCell`. – BigBen Jun 16 '20 at 14:11
  • 1
    `Range(ActiveCell,range("A73")).EntireRow.Delete` ? But take on board BigBen's comment. – SJR Jun 16 '20 at 14:12
  • The first part of the macro was quite long and I didn't want to make this overly complicated to understand but SJR's comment seems to have fixed my issue. I guess I simply didn't format it properly. Thank you :) – Cruxer Jun 16 '20 at 14:18
  • I will also try and remove the Select in my code as suggested by BigBen. – Cruxer Jun 16 '20 at 14:22
  • Range(Selection,"A73").EntireRow.Delete – RetiredGeek Jun 17 '20 at 01:49

0 Answers0