Question : Macro to clear all rows below the last cell of data

The macro I am trying to write will scroll to the row below the last cell with data in column B, and then clear all the rows from that point down to the bottom.

For example, if the last value is in row 15, it will clear all the content in all the columns from row 16 to the last row in the spreadsheet.

Thanks!
1:
2:
3:
4:
5:
6:
7:
Sheets("Formatted Actuals").Select
    Range("B4").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Rows("1:64732").EntireRow.Select
    ActiveCell.Offset(1, 0).Range("A1").Activate
    Selection.ClearContents
    Range("A1:J1").Select

Answer : Macro to clear all rows below the last cell of data

This code will kill the rows quickly without looping

Cheers

Dave
1:
2:
3:
4:
5:
6:
7:
Sub Kill()
    Dim rng1 As Range
    Sheets("Formatted Actuals").Select
    Set rng1 = Cells(Rows.Count, "B").End(xlUp).Offset(1, 0)
    Set rng1 = Range(rng1, rng1.End(xlDown))
    rng1.EntireRow.ClearContents
End Sub
Random Solutions  
 
programming4us programming4us