Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assigning a Variable to an Expression that Includes a Variable andVBA Property | Excel Programming | |||
Nothing Keyword Destories Objects rather than just resetting the variable to an empty variable | Excel Programming | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |