View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom82 Tom82 is offline
external usenet poster
 
Posts: 5
Default Macro to insert row in protected sheet

Hi, I created easy macro below to enter a predesigned (formats and formulas)
row in a protected sheet and then protect it again. Now I would like to set
the macro that it will insert the line above the cell in which I'm standing
at the time that I activate the Macro. Furthermore, I would like to fix the
row that I enter.... in this case it is row 65..but when I execute the Macro
ones, it will become row 66... Can somebody tell me which changes I have to
make in the codes?Thanks

ActiveSheet.Unprotect
ActiveWindow.SmallScroll Down:=21
Rows("65:65").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-21
Rows("20:20").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub