Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Error 1004 when selecting a range

I have the following code in a Macro and it works fine. When I copy it to a click event for command button I get a Run-time error 1004 "Select Method of Range class failed.

Sheets("SOAUDITSO").Select
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp

What am I doing wrong?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Error 1004 when selecting a range

Sorry for the duplicate I got an error when it was posting


"Matt J" wrote:

I have the following code in a Macro and it works fine. When I copy it to a click event for command button I get a Run-time error 1004 "Select Method of Range class failed.

Sheets("SOAUDITSO").Select
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp

What am I doing wrong?

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
1004 error when selecting a range Matt J[_2_] Excel Programming 9 July 3rd 04 10:05 PM
Error 1004 using Shapes.Range().Align juergen Excel Programming 3 June 25th 04 11:14 AM
Range.Copy and error 1004 Carl Rapson Excel Programming 5 November 15th 03 03:21 AM
Run-time 1004 error on range select Morgan[_3_] Excel Programming 3 November 11th 03 11:44 PM
Range.cells.calculate give error 1004 only in XP Stef[_3_] Excel Programming 1 October 31st 03 02:57 PM


All times are GMT +1. The time now is 01:56 PM.

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

About Us

"It's about Microsoft Excel"