Macro to increase data range

  • Thread starter Thread starter H.Schurch
  • Start date Start date
H

H.Schurch

Dear Excel Enthusiasts

Unfortunately I have no knowledge of VBA. I would like to create a Command
or Macro button that would add a new row to a range of data, and one button
that would remove a row from a range when it is clicked

I have data in 25 rows at the moment, the populated range starts at cell A3
and the last populated cell is R25. Cell A25 has a label called "TOTAL". In
that row all the data from row 3 to row 24 is summed up. The number of rows
can change but will never be more than 200. I would like a Macro that would
copy the formulas and formatting of the row above the "TOTAL" row, copy it,
insert a new row and paste it to the new row. This way if more rows are
needed I can just increase the data range with aclick of a button.

The "Remove Macro" should do the opposite.

Any Help is greatly appreciated
 
You didn't say what version but this should do it

Sub NewLineA()
x = Cells(65536, "a").End(xlUp).Row
Cells(x, "a").EntireRow.Insert
Cells(x - 1, "a").EntireRow.Copy Cells(x, "a")
Cells(x, "a").EntireRow.ClearContents
End Sub
 
Back
Top