Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Its so simple! Why won't it work!

I'm going mad. I've tried so many different ways. I've even had it
work, save the project, come back 30 min. later, and then doesn't work.

No changes made.


All I'm trying to do is Select a cell from another sheet.


I'd prefer to select the sheet using: Sheet12 ; rather than it's name:
Loads & I have to use Cells()


Tried these and more...
Worksheets("Loads").Cells(8, 41).Select
Sheet12.Cells(8, 41).Select


"Select Method of Range Class Failed" - error
I assume that has something to do with the '.select'

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Its so simple! Why won't it work!

You can't select cells on a sheet that is not the active sheet.
You have to select the sheet first, then the cells. E.g.,

Worksheets("Loads").Select
Cells(8,14).Select

Of course, it is rarely necessary to use Select in the first
place, so if you post what you are ultimately trying to do,
someone may have an idea how to accomplish it without having to
select a range.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Kevin O'Neill" wrote in message
ups.com...
I'm going mad. I've tried so many different ways. I've even had
it
work, save the project, come back 30 min. later, and then
doesn't work.

No changes made.


All I'm trying to do is Select a cell from another sheet.


I'd prefer to select the sheet using: Sheet12 ; rather than
it's name:
Loads & I have to use Cells()


Tried these and more...
Worksheets("Loads").Cells(8, 41).Select
Sheet12.Cells(8, 41).Select


"Select Method of Range Class Failed" - error
I assume that has something to do with the '.select'



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Its so simple! Why won't it work!

Chip thanks. Worked like a charm. I'm not a programmer by trade, my
Boss always tells me there's no need to 'select' things, but I always
do it anyway. I don't know any better.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Its so simple! Why won't it work!

I'm glad it works. You rarely need to Select a range, and doing
so is a very slow operation. Instead of Selecting, you can use a
Range variable Set to the appropriate range, and use that
variable. For example, instead of


Range("A1").Select
Selection.Font.Bold = True

you could use

Range("A1").Font.Bold = True
or
Dim Rng As Range
Set Rng = Range("A1")
Rng.Font.Bold = True

Because Selection can be any type of object in addition to a
range (a Shape, a Chart, etc), a lot of code must execute behind
the scenes to determine what type of object Selection actually
is.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Kevin O'Neill" wrote in message
oups.com...
Chip thanks. Worked like a charm. I'm not a programmer by
trade, my
Boss always tells me there's no need to 'select' things, but I
always
do it anyway. I don't know any better.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Its so simple! Why won't it work!

Thanks Chip, I'll work that method into my next project. That makes
sense though.

Reply
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
So simple, but I can't get it to work hmsawyer Excel Discussion (Misc queries) 4 April 5th 08 07:58 AM
simple deletion won't work for me jgriffs Excel Discussion (Misc queries) 2 January 29th 06 09:55 PM
Simple but I can't get it to work? PLEASE help!! Naji Excel Discussion (Misc queries) 6 January 11th 06 10:27 PM
Why does this simple thing not work? Peter[_55_] Excel Programming 4 September 22nd 05 06:40 PM
Why this simple macro doesn't work? 71marco71[_8_] Excel Programming 2 February 6th 04 06:53 PM


All times are GMT +1. The time now is 09:20 PM.

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

About Us

"It's about Microsoft Excel"