Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default trouble selecting a named cell

I have a column of cells named/labelled in series thus: _17548, _17549 and
so on.

I have a cell on another sheet whose value will be, depending on whatever
conditions, one of these values.

I need to paste the value of the correspondingly named cell on the first
sheet to another cell on the second.

I am having major difficulty doing this, I try to assign the value of the
source cell as a variable and then paste the contents of the cell with that
name to the target cell, but it just won't accept the "name" of the cell as a
range type variable. It will accept it as a string, but i can't seem to get
it to accept a string variable in a line such as :-
range("variable_name").select

HELP
I hope i've made this clear for you all,
is there a way around this?
Thanks in advance
John Foster
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default trouble selecting a named cell

Hi John,

Try:

Dim Rng As Range

Rng = Range( "_17548")

Sheets("Sheet2").Range("A1").Value = Rng.Value

Note that if you use a range variable, an expression like:

range("variable_name").


will cause an error: the variable, e.g. Rng, refers to a range, so the use
of :

range


is incorrect.


---
Regards,
Norman


"john foster" wrote in message
...
I have a column of cells named/labelled in series thus: _17548, _17549
and
so on.

I have a cell on another sheet whose value will be, depending on whatever
conditions, one of these values.

I need to paste the value of the correspondingly named cell on the first
sheet to another cell on the second.

I am having major difficulty doing this, I try to assign the value of the
source cell as a variable and then paste the contents of the cell with
that
name to the target cell, but it just won't accept the "name" of the cell
as a
range type variable. It will accept it as a string, but i can't seem to
get
it to accept a string variable in a line such as :-
range("variable_name").select

HELP
I hope i've made this clear for you all,
is there a way around this?
Thanks in advance
John Foster



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default trouble selecting a named cell

thanks norman, but method range of object failed @ this line :-
Rng = Range("_17548")
plus I want Rng to contain a cell value (cell a1 - which will be one of the
other cell names - say _17548, or 17549 etc, depending on conditions)

sorry

"Norman Jones" wrote:

Hi John,

Try:

Dim Rng As Range

Rng = Range( "_17548")

Sheets("Sheet2").Range("A1").Value = Rng.Value

Note that if you use a range variable, an expression like:

range("variable_name").


will cause an error: the variable, e.g. Rng, refers to a range, so the use
of :

range


is incorrect.


---
Regards,
Norman


"john foster" wrote in message
...
I have a column of cells named/labelled in series thus: _17548, _17549
and
so on.

I have a cell on another sheet whose value will be, depending on whatever
conditions, one of these values.

I need to paste the value of the correspondingly named cell on the first
sheet to another cell on the second.

I am having major difficulty doing this, I try to assign the value of the
source cell as a variable and then paste the contents of the cell with
that
name to the target cell, but it just won't accept the "name" of the cell
as a
range type variable. It will accept it as a string, but i can't seem to
get
it to accept a string variable in a line such as :-
range("variable_name").select

HELP
I hope i've made this clear for you all,
is there a way around this?
Thanks in advance
John Foster




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default trouble selecting a named cell

Hi John,

How have you named the cell?


---
Regards,
Norman



"john foster" wrote in message
...
thanks norman, but method range of object failed @ this line :-
Rng = Range("_17548")
plus I want Rng to contain a cell value (cell a1 - which will be one of
the
other cell names - say _17548, or 17549 etc, depending on conditions)

sorry

"Norman Jones" wrote:

Hi John,

Try:

Dim Rng As Range

Rng = Range( "_17548")

Sheets("Sheet2").Range("A1").Value = Rng.Value

Note that if you use a range variable, an expression like:

range("variable_name").


will cause an error: the variable, e.g. Rng, refers to a range, so the
use
of :

range


is incorrect.


---
Regards,
Norman


"john foster" wrote in message
...
I have a column of cells named/labelled in series thus: _17548,
_17549
and
so on.

I have a cell on another sheet whose value will be, depending on
whatever
conditions, one of these values.

I need to paste the value of the correspondingly named cell on the
first
sheet to another cell on the second.

I am having major difficulty doing this, I try to assign the value of
the
source cell as a variable and then paste the contents of the cell with
that
name to the target cell, but it just won't accept the "name" of the
cell
as a
range type variable. It will accept it as a string, but i can't seem to
get
it to accept a string variable in a line such as :-
range("variable_name").select

HELP
I hope i've made this clear for you all,
is there a way around this?
Thanks in advance
John Foster






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
Trouble with Pivot Tables & Named Ranges PurpleMilk Excel Worksheet Functions 0 March 4th 10 11:41 PM
Trouble with named data hmm Charts and Charting in Excel 1 September 20th 07 06:57 PM
Trouble with selecting multiple ranges of data markag Excel Worksheet Functions 2 June 23rd 06 04:35 PM
Selecting/Printing a Named Range via VBA Diane M Excel Programming 0 April 23rd 04 06:51 PM
Selecting Named Ranges Ian[_8_] Excel Programming 7 September 22nd 03 03:32 PM


All times are GMT +1. The time now is 11:20 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"