LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Auto Increment formula

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Increment Number Thomas [PBD] Excel Discussion (Misc queries) 0 June 24th 08 10:01 PM
Auto-increment file name Matthew Pfluger Excel Programming 2 May 6th 08 01:55 PM
auto increment Trizzle Excel Discussion (Misc queries) 1 December 6th 06 09:14 PM
DP Auto increment [email protected] Excel Worksheet Functions 2 August 16th 06 12:37 AM
how to auto increment cell location within formula Bill Excel Worksheet Functions 3 February 16th 06 02:23 PM


All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"