ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Duplicate procedure in other sheets (https://www.excelbanter.com/excel-programming/436669-duplicate-procedure-other-sheets.html)

Gotroots

Duplicate procedure in other sheets
 
What is the best way to duplicate a row insertion in other sheets of a
workbook.

Let me explain by example.

There are 5 sheets in the workbook

Sheet1!

a row is added at R12
A12:G12 are copied from the cell range immediately above

Sheet2! - Sheet5!

These sheets will need the same procedure carried out at R12

Hope someone has the answer. Thank you.


MRT

Duplicate procedure in other sheets
 
when you add and copy at the sheet1, select all sheets.
(under selecting Sheet1 condition, Shift + Ctrl + PgDn )

HTH
if i have false conception, pls forgive and forget.
--
MRT

"Gotroots" wrote in message ...
What is the best way to duplicate a row insertion in other sheets of a
workbook.

Let me explain by example.

There are 5 sheets in the workbook

Sheet1!

a row is added at R12
A12:G12 are copied from the cell range immediately above

Sheet2! - Sheet5!

These sheets will need the same procedure carried out at R12

Hope someone has the answer. Thank you.


JLGWhiz[_2_]

Duplicate procedure in other sheets
 
See if this does what you want:

Sub insrtRw()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Sheets
sh.Rows(12).Insert
sh.Range("A11:G11").Copy sh.Range("A12")
Next
End Sub

Open the VBE, Alt + F11, and copy/paste the code into the code window. If
the window is dark, then from the VBE menu bar InsertModule, then
copy/paste the code. You can run the code from Excel with
ToolsMacroMacros then select this macro name and click run.




"Gotroots" wrote in message
...
What is the best way to duplicate a row insertion in other sheets of a
workbook.

Let me explain by example.

There are 5 sheets in the workbook

Sheet1!

a row is added at R12
A12:G12 are copied from the cell range immediately above

Sheet2! - Sheet5!

These sheets will need the same procedure carried out at R12

Hope someone has the answer. Thank you.





All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com