Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a cell doesn't work?????


I have a change event procedure in Sheet1 that works very well with the
exception of probably the simplest component....selecting a cell. It
gives the following error message;

Runtime error '1004':

Select method of Range class failed

The line that it has the error on reads:

Range("BA1").select

I have writen page after page of macros and this usually works (as it
should). It should be quite a simple procedure. I have ensured that
the sheet is visible and unlocked etc, so that shouldn't be a problem.
The cell is on a different sheet to the sheet the procedure is iniated
from, but i wouldn't have thought that would cause an error. I am sure
the fault is simple, but can't for the life of me find the solution.

What am I doing worng and why won't this simplest of codes work for me?


--
biosci
------------------------------------------------------------------------
biosci's Profile: http://www.excelforum.com/member.php...o&userid=32827
View this thread: http://www.excelforum.com/showthread...hreadid=530296

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Selecting a cell doesn't work?????

try Range("BA1").activate


"biosci" wrote in
message ...

I have a change event procedure in Sheet1 that works very well with the
exception of probably the simplest component....selecting a cell. It
gives the following error message;

Runtime error '1004':

Select method of Range class failed

The line that it has the error on reads:

Range("BA1").select

I have writen page after page of macros and this usually works (as it
should). It should be quite a simple procedure. I have ensured that
the sheet is visible and unlocked etc, so that shouldn't be a problem.
The cell is on a different sheet to the sheet the procedure is iniated
from, but i wouldn't have thought that would cause an error. I am sure
the fault is simple, but can't for the life of me find the solution.

What am I doing worng and why won't this simplest of codes work for me?


--
biosci
------------------------------------------------------------------------
biosci's Profile:

http://www.excelforum.com/member.php...o&userid=32827
View this thread: http://www.excelforum.com/showthread...hreadid=530296



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a cell doesn't work?????


Thanks for the tip. I had tried that, but it didn't work.

I have managed to get around this problem by naming the cell which
allows me to enter values into it and use
range("whatever").offset("whatever").name = "myname" to change the
cell, which for most purposes works. Unfortunately I need to use the
line:

activecell.value=activecell.value

the reason I need to use this is that I am trying to plot a curve and
the cells that the X-axis values are taken from contain excel function
and for some reason the values are plottes in the order they are in (ie
1, 2, 3, 4, ) instead of the value in the cell. Apparently if I use

activecell.value=activecell.value

It will convert the cell from text to numbers.

I anyone can shed some more light on the situation with this added
info, it would be very handy.


--
biosci
------------------------------------------------------------------------
biosci's Profile: http://www.excelforum.com/member.php...o&userid=32827
View this thread: http://www.excelforum.com/showthread...hreadid=530296

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting a cell doesn't work?????

Is your code behind a worksheet?

If yes, then the unqualified range will refer to the sheet holding the code.
And if that sheet isn't active, you can't select a range on that sheet.

worksheets("Sheet99").select
worksheets("sheet99").range("ba1").select

will work.

But you don't usually have to select a range to work with it.


biosci wrote:

I have a change event procedure in Sheet1 that works very well with the
exception of probably the simplest component....selecting a cell. It
gives the following error message;

Runtime error '1004':

Select method of Range class failed

The line that it has the error on reads:

Range("BA1").select

I have writen page after page of macros and this usually works (as it
should). It should be quite a simple procedure. I have ensured that
the sheet is visible and unlocked etc, so that shouldn't be a problem.
The cell is on a different sheet to the sheet the procedure is iniated
from, but i wouldn't have thought that would cause an error. I am sure
the fault is simple, but can't for the life of me find the solution.

What am I doing worng and why won't this simplest of codes work for me?

--
biosci
------------------------------------------------------------------------
biosci's Profile: http://www.excelforum.com/member.php...o&userid=32827
View this thread: http://www.excelforum.com/showthread...hreadid=530296


--

Dave Peterson
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
Selecting a cell entry based on cell validation selection Brutalius Excel Worksheet Functions 2 December 17th 08 03:44 AM
Shortcut key for selecting column does not work ch Excel Discussion (Misc queries) 5 April 23rd 08 04:24 AM
Data Validation does not work when selecting another cell. Simon Jefford Excel Discussion (Misc queries) 5 June 29th 05 11:10 PM
custom filter does not work when selecting 'equals' X AND 'equals' plindman Excel Discussion (Misc queries) 1 June 1st 05 11:29 PM
Macro selecting the last used cell does not work Kaj Pedersen Excel Programming 1 November 4th 03 10:25 PM


All times are GMT +1. The time now is 01:13 AM.

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"