Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
runtime error 1004
hi,
i have the following code behind a button in sheet1: sheets("pivot").select range("F2").select but when i click the button in get the following message: runtime error 1004: select method of range clas failed. i did a small test to place the code and button in the same worksheet as the range (pivot sheet), and it worked just fine. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
runtime error 1004
Code in a sheet always refers to that sheet unless otherwise specified. So
your code select the pivot sheet but then it tries to select range F2 on itself (sheet 1). Try this.. with sheets("pivot") .select .range("F2").select end with -- HTH... Jim Thomlinson "geebee" wrote: hi, i have the following code behind a button in sheet1: sheets("pivot").select range("F2").select but when i click the button in get the following message: runtime error 1004: select method of range clas failed. i did a small test to place the code and button in the same worksheet as the range (pivot sheet), and it worked just fine. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
runtime 1004 error | Excel Programming | |||
Runtime error 1004 | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |