Inserting multiple rows in multiple worksheets

A

Andrew

I am trying to develop a worksheet where a number of worksheets are linked to
a master worksheet. The sheets that are linked to the master have similar
formatting ie; alternate rows are shaded & there are formulas, eg; sheet 1 is
master, sheet 2 has blue rows, sheet 3 has green rows, sheet 4 has yellow
rows, etc.
My dilemma is this: The master sheet is protected & not meant for editing,
only calclating & displaying totals. So what i would like to do is if i add a
row (with formatting) in sheet 2 it will automatically add to the master
sheet, if i add row(s) to sheet 3, it will automatically update in the master
sheet and so on. The real problem lies in that fact that i might insert a row
above row #25 on sheet 2 but the corresponding row on the master sheet may be
row # 175, & Sheet 3 row #85 = Master sheet row #250
I currenlty have it set up so that data is entered on sheet 2(or whichever
sheet) & it is automatically updated to the master sheet (simple equal
cells).

I dont know if this is possible or probable but any help appreciated.
I might also add that i've only started exploring vba concepts so may not be
familar with lingo.

Thanks in advance for any help.
 
P

Paul

You could name a range on each sheet being the first row of the standard
structure, then calculate where to insert the rows based on the offset from
that range :

nOffset = selection.row - Range("Sheet1_Top_Row").Row
' This gives you the offset to use when inserting on each of the other sheets

' On the next sheet
nNewRow = Range("Sheet2_Top_Row").Row + nOffset - 1
cells(nNewRow,1).entirerow.insert shift:=xldown
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top