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: 24
Default Inserting additional rows and only copying certain columns

Created a macro that inserts rows based on the number value in a certain
column. So if the column (EL2) shows 3, then the macro will insert 3 rows
beneath that row. However, the macro also copies all of the data from that
row. Would like to find a way to only copy certain columns to the row below.
So instead of the entire row being copied, say insert rows and only copy
columns A through R below.
Here's the macro. Iknow the probelm is in the [cell.EntireRow.Copy
Destination:=cell.Offset(1, 0).EntireRow] section, just can't figure out how
to change it
Thanks for any input


Sub addrows()

Dim cell, cell1 As Range
Set cell = Range("B2")

Do Until cell = ""

Set cell1 = cell.Offset(1, 0)

For i = 1 To cell.Value
cell.Offset(1, 0).EntireRow.Insert
cell.EntireRow.Copy Destination:=cell.Offset(1, 0).EntireRow
Next i

Set cell = cell1

Loop

End Sub

 
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
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
copying formulas when inserting new rows Steve M[_4_] Excel Discussion (Misc queries) 7 September 8th 08 02:55 PM
auto update formula when inserting additional columns dlisman Excel Worksheet Functions 1 August 9th 07 04:28 PM
Additional Rows and Columns in Excel 2007 Debra Lassman Excel Discussion (Misc queries) 1 July 18th 07 04:30 PM
Copying header rows and inserting them into all worksheets mattmac Excel Programming 6 March 28th 07 09:10 PM


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