Insert blank row in table using VBA and automatically populate active cell
I have the following VBA code that inserts a blank row at the top of the table and R4 then becomes the active cell.
Private Sub CommandButton1_Click()
Range("R4").HorizontalAlignment = xlCenter
When inserting a new row, I would like to populate R4 with the year following the previous year which is then in cell R5.
Before VBA code is executed:
After VBA code is executed:
These cells are formatted as text.