Test this code on a copy of your workbook:
Code:Option Explicit Sub InsertSelectedRow() Dim arySheets As Variant Dim lSelectedRow As Long Dim lX As Long If Selection.Rows.Count > 1 Then MsgBox "More than one row selected. Exiting." GoTo End_Sub End If arySheets = Array("Sheet1", "Sheet3", "Sheet8") lSelectedRow = Selection.Row For lX = LBound(arySheets) To UBound(arySheets) With Worksheets(arySheets(lX)) .Select .Unprotect .Rows(lSelectedRow).Select Selection.Copy Selection.Insert Shift:=xlDown .Protect DrawingObjects:=True, Contents:=True, Scenarios:=True End With Next End_Sub: End Sub


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks