Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default value of value of a variable.

I tried searching, but no use!

I have a Const NameA = "BLA BLA"
I have a variable NameB

Value of NameB is NameA.
How do i get the text "BLA BLA" from NameB variable

Is there anyway to do that?

something like,, VALUE(NameB)

Thanks & Regards
Joe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default value of value of a variable.

Hi
Dim NameB as String
NameB = NameA

in a cell you could have
range("A1").Value = NameB

would now have content "BLA BLA"

regards
Paul
On May 21, 12:35*pm, Joe wrote:
I tried searching, but no use!

I have a Const NameA = "BLA BLA"
I have a variable NameB

Value of NameB is NameA.
How do i get the text "BLA BLA" from NameB variable

Is there anyway to do that?

something like,, * VALUE(NameB)

Thanks & Regards
Joe


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default value of value of a variable.

On May 21, 4:43*pm, Paul Robinson
wrote:
Hi
Dim NameB as String
NameB = NameA

in a cell you could have
range("A1").Value = NameB

would now have content "BLA BLA"

regards
Paul
On May 21, 12:35*pm, Joe wrote:

I tried searching, but no use!


I have a Const NameA = "BLA BLA"
I have a variable NameB


Value of NameB is NameA.
How do i get the text "BLA BLA" from NameB variable


Is there anyway to do that?


something like,, * VALUE(NameB)


Thanks & Regards
Joe


Thanks Paul for the reply.

But in my case there is a difference

Its not NameB = NameA
its rather NameB= "NameA"


is there a way out?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default value of value of a variable.

I don't think you can do what you are trying to do, at least not with Const
statements and variables. I'm guessing you will have more constants than
NameA, so you might want to consider using a Collection. Consider the
following...

Dim Coll As New Collection
Dim GetNamesText As String
'....
'....
Coll.Add "BLA BLA", "NameA"
Coll.Add "YEAH YEAH", "NameB"
Coll.Add "UH HUH", "NameC"
'....
'....
GetNamesText = Coll("NameA")
MsgBox GetNamesText
GetNamesText = Coll("NameB")
MsgBox GetNamesText
GetNamesText = Coll("NameC")
MsgBox GetNamesText

--
Rick (MVP - Excel)



"Joe" wrote in message
...
On May 21, 4:43 pm, Paul Robinson
wrote:
Hi
Dim NameB as String
NameB = NameA

in a cell you could have
range("A1").Value = NameB

would now have content "BLA BLA"

regards
Paul
On May 21, 12:35 pm, Joe wrote:

I tried searching, but no use!


I have a Const NameA = "BLA BLA"
I have a variable NameB


Value of NameB is NameA.
How do i get the text "BLA BLA" from NameB variable


Is there anyway to do that?


something like,, VALUE(NameB)


Thanks & Regards
Joe


Thanks Paul for the reply.

But in my case there is a difference

Its not NameB = NameA
its rather NameB= "NameA"


is there a way out?


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
Assigning a Variable to an Expression that Includes a Variable andVBA Property bluebird[_3_] Excel Programming 3 April 27th 09 07:38 AM
Nothing Keyword Destories Objects rather than just resetting the variable to an empty variable Ronald R. Dodge, Jr.[_2_] Excel Programming 15 December 15th 08 09:19 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 04:42 PM.

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"