LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default "Run-time error '1004'

Greetings:

In Excel 2007, I wrote a macro to insert a line between all visible
rows. However, one portion of the code fails and I am unable to
isolate the reason.

The specific error is:

Microsoft Visual Basic "Run-time error '1004':
Insert method of Range class failed

The section of the following code that fails is
"Selection.EntireRow.Insert". Any suggestions would be appreciated.
Thank you.

' select range for unique filter and insert rows

Range("A1").Select
Application.CutCopyMode = False
Range("A:A").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
ActiveSheet.ShowAllData


 
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
Run-time-error 1004 "ListIndex method of listbox class failed" Fan924 Excel Programming 1 October 19th 10 10:56 PM
how do I correct a "run time error 1004-unable to open" problem? BillR Excel Programming 1 August 26th 08 07:21 PM
"run-time error '1004' - select method of range failed" maemi weirdoke Excel Programming 2 March 5th 08 03:15 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
"Run-time error '1004'" Method 'Range' of object '_global' failed. haisat[_2_] Excel Programming 0 October 20th 03 12:13 PM


All times are GMT +1. The time now is 09:28 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"