Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting a cell entry based on cell validation selection | Excel Worksheet Functions | |||
Shortcut key for selecting column does not work | Excel Discussion (Misc queries) | |||
Data Validation does not work when selecting another cell. | Excel Discussion (Misc queries) | |||
custom filter does not work when selecting 'equals' X AND 'equals' | Excel Discussion (Misc queries) | |||
Macro selecting the last used cell does not work | Excel Programming |