Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Runtime 1004 error -- insert method of range class failed.

I'm getting this error when I try to run the macro. This is a worksheet &
macro that I inherited from the previous person. I'm usin Excel 2003. I tried
the macro on another person's computer, same error. I cut and pasted the code
into a blank worksheet and it worked fine!! Anyway, below is the code... Can
anyone offer any guidance on how to fix??

Sub Add_Current_Month()
'
' Add_Current_Month Macro
' Macro recorded 9/6/2001 by Department Of Treasury
'
' Keyboard Shortcut: Ctrl+a
'
Rows("12:12").Select
Selection.Insert Shift:=xlDown
Range("F12").Select
ActiveCell.FormulaR1C1 = "=1"
Range("F13").Select
ActiveCell.FormulaR1C1 = "=1+R[-1]C"
Range("D12").Select
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("D13").Select
ActiveCell.FormulaR1C1 = "=R[-1]C+RC[-1]"
Range("E12").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/RC[1]"
Range("A12:C12").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("A13:F13").Select
Selection.Copy
Range("A12:F12").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("A12").Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Runtime 1004 error -- insert method of range class failed.

Lord, there's power in posting..! I figured this one out. Needed to
"unprotect" the worksheet first.. duh!



"tish" wrote:

I'm getting this error when I try to run the macro. This is a worksheet &
macro that I inherited from the previous person. I'm usin Excel 2003. I tried
the macro on another person's computer, same error. I cut and pasted the code
into a blank worksheet and it worked fine!! Anyway, below is the code... Can
anyone offer any guidance on how to fix??

Sub Add_Current_Month()
'
' Add_Current_Month Macro
' Macro recorded 9/6/2001 by Department Of Treasury
'
' Keyboard Shortcut: Ctrl+a
'
Rows("12:12").Select
Selection.Insert Shift:=xlDown
Range("F12").Select
ActiveCell.FormulaR1C1 = "=1"
Range("F13").Select
ActiveCell.FormulaR1C1 = "=1+R[-1]C"
Range("D12").Select
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("D13").Select
ActiveCell.FormulaR1C1 = "=R[-1]C+RC[-1]"
Range("E12").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/RC[1]"
Range("A12:C12").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("A13:F13").Select
Selection.Copy
Range("A12:F12").Select
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("A12").Select
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method 'MacroOptions' of object'_Application' failed Runtime Error 1004 EagleOne Excel Discussion (Misc queries) 1 October 22nd 14 05:49 PM
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
runtime error 1004 method range of object '_global failed valdesd Excel Discussion (Misc queries) 2 October 6th 05 07:26 PM
Help: runtime error - Method seriescollection object_chart failed huangx06 Charts and Charting in Excel 3 July 9th 05 12:27 AM


All times are GMT +1. The time now is 10:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"