Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is there a better solution than the macro below. <CODE BEGIN Sub InsertRow3() 'Add row / Insert Row, Copy/Paste Row contents, Clear Row contents 'To increment formula when adding data below last row with data _ insert row above last row with data then copy last row data _ & paste data in inserted row 'Insert row above last row with data (ActiveCell) ActiveCell.Offset(0, 0).EntireRow.Insert 'Copy last row with data contents (Below ActiveCell) Rows(ActiveCell.Offset(1, 0).Row & ":" & _ ActiveCell.Offset(1, 0).Row).Copy 'Paste last row with data contents (ActiveCell) ActiveCell.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False 'Clear last row with data Rows(ActiveCell.Offset(1, 0).Row & ":" & _ ActiveCell.Offset(1, 0).Row).ClearContents 'Select Last Row ActiveCell.Offset(1, 0).Select End Sub <CODE END Thanks for your help, jfcby |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Increment Number | Excel Discussion (Misc queries) | |||
Auto-increment file name | Excel Programming | |||
auto increment | Excel Discussion (Misc queries) | |||
DP Auto increment | Excel Worksheet Functions | |||
how to auto increment cell location within formula | Excel Worksheet Functions |