![]() |
|
#1
|
|||
|
|||
|
Hi,
I'm fairly new to macros etc. and need some help with this error. I will post the code below, I'm trying to copy and paste a selection of rows from one worksheet to another using a button. It runs fine until I protect the sheet. When I debug it's pointing to this line: Code:
Selection.Insert Shift:=xlDown Insert method of range class failed Here is the code for the entire macro: Code:
Sheets("2nd page").Select
Selection.Copy
Sheets("Job Costing Sheet").Select
ActiveWindow.SmallScroll Down:=30
Rows("502:502").Select
Selection.Insert Shift:=xlDown
Range("B502:P648").Select
Application.CutCopyMode = False
ActiveSheet.PageSetup.PrintArea = "$B$2:$P$648"
ActiveWindow.SmallScroll Down:=18
Range("O647").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-2]C+R[-147]C)"
Range("O648").Select
ActiveWindow.SmallScroll Down:=-9
Range("B624:H624").Select
Thanks! |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I assign a macro to a button when the macro is in my personal workbook? | foolios | Excel Programming | 2 | 07-27-2011 02:41 PM |
| Word doc bug when closing from userform command button click macro | Joe Patrick | Word | 1 | 07-05-2011 08:53 PM |
| Macro Button | B2W | Excel | 2 | 06-18-2010 09:36 AM |
| copy cell from sheet 2 to sheet 3 macro | slipperyjim | Excel Programming | 1 | 02-18-2010 01:31 AM |
| Microsoft Office 2003 winword.exe Debug Error! abnormal prog | elo1bev | Word | 0 | 12-22-2005 10:15 AM |