southpaw163
New Member
- Joined
- Aug 28, 2006
- Messages
- 4
I have a spreadsheet that currently has Buttons made from the Form Toolbox, that I would like to switch to Buttons made from the Control Toolbox. I'm having problems transfering the code from a button that adds a row in my spreadsheet. Everytime I copy the code over it gives me an error in the code. The code is:
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Rows("7:7").Select
Selection.Insert Shift:=xlDown
Sheets("Hide").Select
Rows("15:15").Select
Selection.Copy
Sheets("Preliminary").Select
ActiveSheet.Paste
Range("C7").Select
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
The error it highlights is Rows("15:15").Select. But the macro works just fine when assigned to the Form Toolbox Button. Is there something I'm over looking? Is there any easy way to fix this problem so I can get rid of my Form Toolbox Buttons?
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Rows("7:7").Select
Selection.Insert Shift:=xlDown
Sheets("Hide").Select
Rows("15:15").Select
Selection.Copy
Sheets("Preliminary").Select
ActiveSheet.Paste
Range("C7").Select
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
The error it highlights is Rows("15:15").Select. But the macro works just fine when assigned to the Form Toolbox Button. Is there something I'm over looking? Is there any easy way to fix this problem so I can get rid of my Form Toolbox Buttons?