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 Selecting a range in a different worksheet

The code for a command button on SheetA says:

Worksheets("SheetB").Activate
Range("B2").Select

The "TakeFocusOnClick" property of the command button is set to false.

When the button on SheetA is clicked, the active worksheet switches OK
to
SheetB, but the Range("B2").Select statement generates an error '1004':
"Select method of Range class failed"

Does the code for selecting on SheetB need to be in a separate location
than
the code for SheetA's command button, such as in a Worksheet.Activate
event?

Or what else have I overlooked, left out, or done wrong?

Thanks for any help.

 
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
Please help with selecting a range keri Excel Discussion (Misc queries) 7 December 12th 06 08:56 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Selecting a Worksheet Range Coolboy55 Excel Worksheet Functions 6 August 23rd 05 03:57 PM
selecting a range in vb jws217 Excel Programming 1 December 31st 03 03:58 PM
Help with selecting a range... Don Guillett[_4_] Excel Programming 0 July 22nd 03 03:18 PM


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"