0

I want to delete all values starting from A2:O2 and LOWER , i.e. A3:O3, A4:O4, A5:O5

  A    B    C     ....         O        P    Q
1 ..............................
2 deletedeletedeletedeletedelete
3 deletedeletedeletedeletedelete 
4 deletedeletedeletedeletedelete
5 deletedeletedeletedeletedelete

I am not sure how to do this

Sub DeleteLower()   
    Range("A2:O1048576").Select
    Selection.SpecialCells(xlCellTypeConstants, 23).Select
    Selection.ClearContents
end sub

How do I explain that I need the range of "A2:0 infinity " "A2:O1048576" ?

Aleksei Nikolaevich
  • 325
  • 3
  • 15
  • 40
  • see [HERE](http://www.rondebruin.nl/win/s9/win005.htm) to find your last row. Also, see [THIS](http://stackoverflow.com/questions/71180/how-can-i-find-last-row-that-contains-data-in-the-excel-sheet-with-a-macro) which will lead you to various links on answers posted in SO regarding the same topic. Then see [EXAMPLE](http://stackoverflow.com/questions/21616455/excel-vba-selecting-multiple-dynamic-ranges/21618018#21618018) for various ways on how you can use your `last row(LR)` to get your dynamic range. – L42 Feb 13 '14 at 03:08

1 Answers1

1

Perhaps something like this would work for you:

Sub RemoveValues()
    ActiveSheet.Range(ActiveSheet.Range("A2:O2").Address, ActiveSheet.Cells(Rows.Count, 1).Address).ClearContents
End Sub

This will remove all content from cells A2:O2 and downward.

Netloh
  • 4,338
  • 4
  • 25
  • 38