View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gavin Ayling Gavin Ayling is offline
external usenet poster
 
Posts: 2
Default Error When Assigning a Macro to a Command Button

On 24 Jan, 16:15, mikesaysgobears
wrote:
Thanks for the help - this got me through this problem, but exposed another!
I think the best place for me to start is a book to reference basic issues.
Any suggestions?



"Jim Jackson" wrote:
If your macro is in the sheet's code window you must use:
Activesheet.Range("A1:AN81").Select


--
Best wishes,


Jim


"mikesaysgobears" wrote:


I'm trying to assign a macro (that works with the keyboard shortcut) to a
command button so that others will easily be able to run all the macros on
individual buttons.


I get the following error immediately:


Run time error '1004':


Select method of Range class failed


When I go to debug, the following text is highlighted in yellow:


Range("A1:AN81").Select


This macro is taking data from one spreadsheet and importing it into another
to complete several tests. This is my first foray into writing in depth
macros, so help in laymen's terms would be greatly appreciated.


Thanks- Hide quoted text -- Show quoted text -


To be honest I wouldn't use a book to start with. Read the help file
and the archives of this group for each question as it comes...