ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error When Assigning a Macro to a Command Button (https://www.excelbanter.com/excel-programming/381829-re-error-when-assigning-macro-command-button.html)

Gavin Ayling

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...



All times are GMT +1. The time now is 03:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com