 |
 |

08-30-2005, 01:11 AM
|
|
Junior Contributor
|
|
Join Date: Oct 2004
Posts: 293
|
|
Get Content of cells(row,column) if its a variable
|
Hi Guys
Now i have a string variable..it stores the cells position..for example
str = cells(1,1)
str1 = cells(1,2)
how do i get the value of this cells?
cause i tried str -> but it gives cells(1,1) which it suppose to give..
How can i get the content of cells(1,1) by using str..
THank You..
|
|

08-30-2005, 07:28 AM
|
 |
Centurion
|
|
Join Date: Jul 2003
Location: Wisconsin
Posts: 109
|
|
If I'm reading your question correctly, you have a cell that contains an address to another cell, of which you want to get the value of.
This sounds overly simple, so I'm probably wrong. But if not, you could use something like:
Code:
MsgBox Range(Range("A3").Address).Value
where cell A3 contains the address to another cell.
Hope this helps. Dave
|
|

08-30-2005, 09:37 AM
|
 |
Down...
Retired Moderator * Expert *
|
|
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
|
|
Quote:
|
Originally Posted by davheili
Code:
MsgBox Range(Range("A3").Address).Value
|
Did you actually tried that...
Think you are after this:
Code:
Dim Str As String
Str = Cells(1, 3).Address
MsgBox Range(Str).Value
|
|

08-30-2005, 01:17 PM
|
 |
Centurion
|
|
Join Date: Jul 2003
Location: Wisconsin
Posts: 109
|
|
Quote:
|
Originally Posted by italkid
Did you actually tried that...
|
italkid. Yep your right. It don't work. Apparently there's a flaw in my cut / paste process. Yea, Yea. That's it... A flaw in cut / paste. That's my story and I'm sticking with it.
Actually I think I meant
Code:
MsgBox Range(Range("A3").Value).Value
|
|

08-30-2005, 09:35 PM
|
|
Junior Contributor
|
|
Join Date: Oct 2004
Posts: 293
|
|
|
Hi,
Sorry for the confusing explanation..
Actually i meant..
Lets say now the content of cells(1,1) is cells(1,2)
means if i put
msgbox cells(1,1)
the output i get is
"cells(1,2)" as string
So how do i get the value in cells(1,2) as "cells(1,2)" is a string?
|
|

08-30-2005, 10:43 PM
|
 |
Down...
Retired Moderator * Expert *
|
|
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
|
|
Quote:
|
Originally Posted by a1jit
So how do i get the value in cells(1,2) as "cells(1,2)" is a string?
|
?? that is still confusing me...
If you are after the contents of Cells(1, 2) then you'll have to pull the number out of that string to be able to use them in a valid range reference. Otherwise you might store that address as B1 instead of Cells(1, 2), and use an INDIRECT() formula to get the cell's contents...
|
|

08-30-2005, 11:22 PM
|
|
Junior Contributor
|
|
Join Date: Oct 2004
Posts: 293
|
|
Ok, sorry
Actually i myself am confused..
Now i have a series of cells stored in a particular cell..for an example
cells(1,1) has this content in it
"cells(1,2)|cells(1,8)|cells(2,1)|cells(1,9)"
something like that..so i split it by "|"
so i get
array(0) = cells(1,2)
array(1) = cells(1,8)
ETC..
so now, each of this array is of type string..
the problem is the i want to get the value of array(0) - means the value in cells(1,2) ..
whenever i do array(0) -> i get cells(1,2)
So how do i get the value of cells(1,2)
|
|

08-31-2005, 09:24 AM
|
 |
Down...
Retired Moderator * Expert *
|
|
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
|
|
Ok, in the first place, why those cell addresses (and in that particular format) in a cell?
Conserning your array... you could use text functions to get the row and column number out of each array item. Replace() for instance "Cells(" and ")" by "", and the result would be "1, 2", then get everything to the Left() from the comma, and everything to the Right() of the space...
Btw, don't start other threads about the same issue as long this particular issue is not solved (I deleted it)...have some patience 
|
|

08-31-2005, 07:21 PM
|
|
Junior Contributor
|
|
Join Date: Oct 2004
Posts: 293
|
|
 sorry italkid..i wont repeat it again...ok..thx for the idea..
|
Last edited by a1jit; 08-31-2005 at 07:27 PM.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|