LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Insert and Copy Data to new Workbook Row

Apologies for the re-post but I originally posted this request into the wrong
forum!

I need to insert a new row into a workbook where a character in Column "A" =
"D" and then copy the row which is two rows above into the new inserted row.

I can insert the row ok with the following code;

Sub Add_Rows()

Dim lastrow As Long, i As Long

lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 2 Step -1
If Cells(i, 1) = "D" Then
Rows(i).Insert
End If
Next
End Sub

but what I can't do is copy the cells in 2 rows above this newly inserted row?

..

I have been searching and reading numerous threads and links but to no avail.

Can anyone assist?, i am using 2003.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200604/1
 
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
How do I copy a header to insert on multilpe sheets in a workbook Coop Excel Discussion (Misc queries) 2 July 28th 06 08:26 PM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM
create a copy of a sheet and insert it into the same workbook. Kaak[_19_] Excel Programming 0 July 15th 05 12:56 PM
create a copy of a sheet and insert it into the same workbook. funkymonkUK[_54_] Excel Programming 0 July 15th 05 12:31 PM
Insert Row & copy all formulas - shared workbook Eager2Learn[_6_] Excel Programming 1 June 10th 04 05:11 AM


All times are GMT +1. The time now is 10:25 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"