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: 1
Default New to VBA, getting unexpected error 1004


Hi all,

I'm having difficulty understanding why some code created by the Macro
Recorder will not work for a Command Button Click Event.

To illustrate the problem, I created the following macro (in Excel
2000):

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/4/2006 by Teodomiro
'

'
Sheets("Sheet2").Select
Range("A1:B20").Select
End Sub


Running it as a macro, it works fine. But when I create a Command
Button, and copy the code into it's Click event, I get:

Run-time error '1004':
Select method of Range class failed


I'm just trying to select a range on a different sheet. Can anyone
explain what's going on here?


--
Teodomiro


------------------------------------------------------------------------
Teodomiro's Profile: http://www.excelforum.com/member.php...o&userid=33140
View this thread: http://www.excelforum.com/showthread...hreadid=529515

 
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
Solver Error - an unexpected internal error has occurred Steve Excel Discussion (Misc queries) 1 February 12th 09 03:18 AM
Solver Error - an unexpected internal error has occurred Steve Excel Discussion (Misc queries) 0 February 12th 09 02:35 AM
Solver Error - an unexpected internal error has occurred Steve Excel Discussion (Misc queries) 0 February 12th 09 02:19 AM
Solver Error - an unexpected internal error has occurred Steve Excel Discussion (Misc queries) 0 February 12th 09 02:19 AM
Unexpected error 1004 when using workbooks.open AHD Excel Programming 5 June 6th 05 11:19 PM


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