Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

runtime error 1004

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 21 Sep 2007 16:44 GMT
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.
Jim Thomlinson - 21 Sep 2007 17:44 GMT
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
Signature

HTH...

Jim Thomlinson

> hi,
>
[quoted text clipped - 7 lines]
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.