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: 5
Default inserting and copying rows over multiple sheets

I am trying to insert and copy rows over multiple sheets, here is what
i have:


Sub SetParam()
'
' SetParam
' Number of rows and colums
Dim Rng
Rng = InputBox("Enter number of rows required.")

'Select Relevant Sheets
Sheets(Array("Variance", "Variance (C)", "Res Risk", "UtilHrs", "LTD
Hr", "WDV", _
"WDV(2)", "Lease", "INT", "Depn", "INS", "Hire", "MMR", "GM",
"Labour", "TyreTrack", _
"GET", "Lube", "bcm", "Revenue", "Op Lease Int", "Depn OP",
"Op lease", "Fuel")).Select

'insert rows
Sheets("Variance").Activate
Rows("7:7").Select

Selection.Offset(Rng - 1, 0).Select
Selection.EntireRow.Insert



'Copy Formula
Dim iLastRow As Long
Dim ilastcol As Long
ilastcol = Cells(6, Columns.Count).End(xlToLeft).Column
iLastRow = Rng + 6
Range("a6", Cells(6, ilastcol)).AutoFill Destination:=Range("a6",
Cells(iLastRow, ilastcol)), Type:=xlFillDefault

Sheets("Cashflow").Select
Range("B2").Select
End Sub


This code only inserts and copys rows to the "Variance" Sheet though,
can any suggest a fix so that is does it to all sheets?

Thanks

 
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
Inserting multiple rows and copying formulas [email protected] Excel Discussion (Misc queries) 3 September 13th 07 03:24 PM
need help please inserting multiple rows based on cell value then copying to data sheet [email protected] Excel Worksheet Functions 1 July 1st 07 08:44 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 10:43 AM.

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"