Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all,
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() Sheets("Data").Range("R4").Select ActiveCell.EntireRow.Insert Shift:=xlDown Range("R4").HorizontalAlignment = xlCenter End Sub When inserting a new row, I would like to populate R4 with the year following the previous year which is then in cell R5. For example: Before VBA code is executed: R4: 2014 R5: 2013 R6: 2012 After VBA code is executed: R4: 2015 R5: 2014 R6: 2013 R7: 2012 These cells are formatted as text. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I insert a blank row when a value changes, automatically | Excel Worksheet Functions | |||
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... | Excel Programming | |||
How do I automatically insert a blank row between sets of data? | Excel Discussion (Misc queries) | |||
Populate current active cell - Help Please!! | Excel Worksheet Functions | |||
automatically insert 8 blank rows between each record | Excel Discussion (Misc queries) |