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
0
Joe
5/21/2010 11:35:22 AM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
839 Views

Similar Articles

[PageSpeed] 25

Hi
Dim NameB as String
NameB =3D NameA

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

would now have content "BLA BLA"

regards
Paul
On May 21, 12:35=A0pm, Joe <joe.varghese.j...@gmail.com> wrote:
> I tried searching, but no use!
>
> I have a Const NameA =3D "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,, =A0 VALUE(NameB)
>
> Thanks & Regards
> Joe

0
Paul
5/21/2010 11:43:07 AM
On May 21, 4:43=A0pm, Paul Robinson <paul.robin...@it-tallaght.ie>
wrote:
> Hi
> Dim NameB as String
> NameB =3D NameA
>
> in a cell you could have
> range("A1").Value =3D NameB
>
> would now have content "BLA BLA"
>
> regards
> Paul
> On May 21, 12:35=A0pm, Joe <joe.varghese.j...@gmail.com> wrote:
>
> > I tried searching, but no use!
>
> > I have a Const NameA =3D "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,, =A0 VALUE(NameB)
>
> > Thanks & Regards
> > Joe

Thanks Paul for the reply.

But in my case there is a difference

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


is there a way out?
0
Joe
5/21/2010 12:01:50 PM
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" <joe.varghese.john@gmail.com> wrote in message 
news:e758eca8-6ec9-44de-925c-9be75b7de472@j36g2000prj.googlegroups.com...
> On May 21, 4:43 pm, Paul Robinson <paul.robin...@it-tallaght.ie>
> 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 <joe.varghese.j...@gmail.com> 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? 

0
Rick
5/21/2010 3:41:24 PM
Reply:

Similar Artilces:

combo and show first value
Hi, I have a combobox that pulls its options from a table. When the form is opened, the combo is blank until the user chooses one of the options. The options change regularly depending on the current records in the table. I'd like the combobox to show the first option in its list instead of being blank. Is that possible? Thanks Jeff C You can use the form OnLoad event to set the first value in the combo You can set it hard coded Me.ComboName = 1 Or, I prefer setting it so the value will be brought from the table that the combo use, with the right sort, so you'll always get ...

Turning 1 and 0 values into Yes and No
Hi, I have a form with yes no buttons for people to select things. For instance, if a person wants to send a business card they click on the business card button on the form. I then created a report based on all of the selections that people make. The values are all 0 and 1 on the report but I want to make them Yes and No. Is there a way to do this in the report? Thanks, -- Chuck W You can set the format property of your text box to display Yes or No based on the bound numeric value. Check Help for various options if you can't figure this out. -- Duane Hookom MS Access MVP ...

Matching values in 2 Columns
Hello, In Column A I have a list of unique case Numbers. (around 3000) A1 123456 A2 234567 A3 345678 In Colums B I have a list of unique case Numbers (around 4000). B1 654321 B2 543210 B3 123456 Some of the numbers in column A are the the same as in column B. Mos of them are not. Is there a way to get only the numbers that are common to bot Columns? (In the exemple above A3 = B3) That is the only case number I' interested in having. At the moment I need to go through both colum list and see which ones are the same... Help -- Message posted from http://www.ExcelForum.com Hi see: h...

displaying parameter value on report
Hey all, I'm trying to add the parameter value in my report, in a textbox. I have tried is with: =Parameters!Parameter.Label , =Parameters!Parameter.Value and =Join.String(Parameter!parameter.Value,",") Both of them aren't working for me, I get a notification that mt header is moved. Can someone help me with this problem Have you just tried the expression builder. It will let you pick the parameter. Also, is this a multi-select parameter? =Join(Parameters!Container.Value, ", ") The above works, the parameter name was Container. I notice ...

How can I autohide rows that have "zero" values?
I have a spreadsheet used to develop construction estimates. In the detail worksheet there are times that the estimate value for a particular component is zero. As the detail worksheet has over 1500 work items (rows) and I need to print this worksheet as part of the estimate, I need to hide those work items (rows) that have zero cost. Right noe=w I have to manually hide each row prior to printing. I have tried "Filter" from the Data tab, but it does not work the way I need it to. It will not automatically adjust for changes in the spreadsheet values and it cannot be use...

Sending the variable to a query as a criteria
Hello, I can send a value as a criteria to a specific query if it is a text of a textbox, combobax, label etc. But, i wonder if i can send a variable to a guery... I mean, such as... dim a as integer a= me.texbox3.value requery xxx... And in xxx, there should be column, for ex. xyz that has the criteria a.. But it does not work :( How can i do it? thanks... SupperDuck wrote: > Hello, > > I can send a value as a criteria to a specific query if it is a text > of a textbox, combobax, label etc. > > But, i wonder if i can send a variable to a guery... Create a us...

Value Search From a List in a Column
I want to use a formula to select from a list of products in a column that is related to 2 variables eg if c1 = 2 and c4 = 400 then sum equals EV-R2-400. The list of products relates to changes in Rx and -x eg EV-R2-400 (cell S1) EV-R8-800 (cell S2) EV-R16-1000 (cell S3) EV-R32-1600 (cell S4) I can use this sum to select just one option, but cannot enlarge it =IF(AND(c1>0,c1<5,c4=400),S1,0) Any ideas, thanks. Sorry Duncan, but I'm having trouble interpreting what you're after. If you are trying to return the Product Number that relates to a certain pair of entries in C1 &a...

Create Named Range for each unique value
Hi! All help is welcome here... Am really stuck. What I have is a list of room numbers. Many appear multiple times i column A, but it will always be sorted. What I need is a way to easily create Named Ranges for each group of rooms. (ie all rows with value 1 becomes one named range, rows with value 5 becomes one named range and so on) Range Name should prefereable be same a room name. Would like the code to go through column A and create ranges for each unique value. (could also have a "supporting" sheet with uniqe values if necessary) Any takers? If the valu...

Excel Graphing With Widely Divergent Values
I searched but couldn't find anythign about this problem. Here's the basic premise: I've got two dollar variables I want to graph over time. The first variable is in the $10 range over the period. The second variable is in the $100,000 range. How can I adjust/concatenate/whatever the scale so that I can meaningfully display the two variables on one graph? Right now, I end up with two straight lines separated by acres of blank space. Thanks! Select the custom chart type, "Line - Column on 2 Axes". I'd already done that, but had hoped there was a way to adjust...

calculation of future value between two dates
HELP please. I am trying to find an easy / short way to calculate future value of a lump sum amount between two dates. The info I will have :- 1. Amount (say $1000 ) 2. Start date of deposit (1st jan 2008) 3. Date to which future value is to be calculated to (1st may 2010) 4. Interest rate ( fixed 10%) 5. Compounded semiannualy. How can I create a formulae to calculate this in one swoop ? "manas123" <manas123@discussions.microsoft.com> wrote: > How can I create a formulae to calculate this in one swoop ? For an approximation: =FV(10%/2, DATEDI...

Filter for Same Value in Two Fields
There are two fields in my query. "From" and "To". For sake of ease, let's say both these fields are US Cities. How can I pull all the records that show shipped "From" Denver and that show shipped "To" Denver? Thank you in advance. You stated: shipped "From" Denver and that show shipped "To" Denver Technically this would mean both values were Denver which might not make much sense if you expected the From and To to be different. Assuming you are viewing your query in design view, you would type "Denver" und...

"conditional formatting" "#values"
I have a formula that works fine but... some of the cells show #values, what i would like to do is conditional formatting them to white font if = #values. Any pointers? many thanks Try this: Select the cells to be impacted (I'll assume A1:A10, with A1 as the active cell) From the Excel main menu: <format><conditional formatting> Condition_1 Formula is: =ISERROR(A1) Click the [Formatting] button.....set the White font....Click the [OK] buttons. Does that help? *********** Regards, Ron XL2002, WinXP "Dewi..." wrote: > I have a formula that works fine bu...

Pull down menues with automatic values
Well this is my first time here and the first time i have known abou the forum. Im not into Excel as a use on a daily base scenario, but i have got t use it a lot in my University course from now on. Ive been asked to produce a spreadsheet which will allow a user t create their own computer. The user HAS to select certain component like motherboard, hard drive, processor etc. Beside each component there should be a drop down list to give the use a wide choice of products relating to the component, then when the select what they want, the price of that component should show u beside the com...

Passing Variables
Sorry to keep asking questions about passing variables, but here is another one hope you can help. I have a macro that received one set of values so I call it Macro1(X), where X is the value that is received. But Macro1(X) calculates about 20 other variables Y,Z,A,.... using the value X. If I call Macro1(X) and I need one of the variables how do I get it, do I have to declare global variables. Thanks First of all, ensure that you have Option Explicit as the very first line in the code module (before and outside of any procedure). This will force you to declare all your variable rat...

VB Variable Help!
Hi, I have a bit of VB Excel code which uses a formula. For this example I have a variable (start_distance) which counts the column distance from Column A, therefore my variable gives me -6. What I want to do is replace the -6 in the formula with the variable, therefore if my variable changes then so would the formula. However, when I replace the -6 in the formula with the variable, I get a Runtime Error 1004. If I leave the number as -6 it all works fine. I'm lost here? Do I need to Dim my variable as something other than double?? Please can someone show me how to write the formul...

Getting a value from a dialog Form
Hi, I seem to be stuck and although I'm still looking for a solution I decided I'll give it a try and ask you for help as well. I've got this function: (I've numbered the lines here, they don't exist in the real project) > Public Function fncNewGrossCost() As Long > 1: > 2: DoCmd.OpenForm "frmNewGCost", acNormal, , , , acDialog > 3: fncNewGrossCost = Nz(Forms("frmNewGCost").txtNewGCostAccepted, 0) > 4: DoCmd.Close acForm, "frmNewGCost" > End Function It's supposed to open a form with one textbox (txtNewGCostAccepted) a...

Formula based on variable range
I am using Excel 2003. Cells A1 through X1 contain dates 01-Jan-2008, 01-Feb-2008 ... 01-Dec-2009. They are formatted Jan-2008, Feb-2008 ... Dec. 2009. The point is that the day does not matter. Cells A2 through X2 contain numbers corresponding to the dates (actually, the month and year represented by the date). Maybe something like 2, 1.5 ... 3. I would like to specify a month/year and see the total for the cells in the second row for that month\year and the 11 preceding it. For instance, July 2009 is the end of a twelve-month period August 2008 through July 2009. These valu...

how to increase value in several cells by a percentage
I want to increase the dollar value in several cells on the same worksheet by a certain percent. I want to be able to do this annually with the percent possibly changing. This is to be used for price increases. Hi try the following (e.g. for a 5% increase) - put 1.05 in an empty cell and copy this cell - select your dollar values - goto 'Edit - Paste Special' and choose 'Multiply' -- Regards Frank Kabel Frankfurt, Germany "mscolaro" <mscolaro@discussions.microsoft.com> schrieb im Newsbeitrag news:B7A34DB8-7A9B-4305-B6D1-5C7231702D8C@microsoft.com... > ...

Radio Button with allowing more than 1 value to choose from
Please add the ability to have more than 2 values to choose in a radio button format, where we would add the values when creating the attribute, similar to the picklist. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Communi...

SUM for logical values
Using Excel 2002 SP3... If I type logical values into the formula, like this: =SUM(TRUE, TRUE, TRUE), my formula returns the value 3. If I reference cells containing logical values, like this =SUM(A1:A3), my formula returns 0. Does anybody know why there is a difference? -- tj Try: =A1+A2+A3 -- Regards, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "tjtjjtjt" <tjtjjtjt@discussions.microsoft.c...

Newbie question on variables
I had a coder write me a VBA which was rife with errors and he disappeared on me so I've spent the last few days somehow managed to slog through and make fixes (don't know VBA or coding) However I am stuck on my last fix. Essentially there are a # of functions within a larger one I need to set a variable inside an if/then statement and store it in a cell on the WS to access in a later function. Based on how he wrote to cells I did this wsCert.Cells(targetCertRowNumber, 300).Value = "Name" which worked inside other functions However I get this error ...

Compare columns pull unique values and first duplicate value
I have 2 worksheets: First worksheet, 1st column has department abbreviations, 2nd columns has the formal department names names Second worksheet, 1st column has abreviations, 2nd column contains department nicknames, 3rd column contains floor space by the floor for each department, 4th column contains the total workspace for each department. (I did a vlookup to sum floors) On a new worksheet First column compare abreviations from first column in other worksheets and return the nickname (unique values and first duplicate) and in the Second column return the total workspace for the departmen...

Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet
I'm wondering how BEST to accomplish this. I have a EXCEL workbook which populates data to, and retrieves data from SQL Server. I currently have VBA code which effectively sends the data from the EXCEL worksheet to SQL Server tables -- no problem with this. I currently have VBA code which effectively retrieves data from SQL Server and displays that data back into the worksheet -- no problem with this either. I'm currently using a Command Button (on-click event) and the code below to query SQL Server to determine the Max Version Number and add 1 to that value. This value is t...

merge multilple data values
how would I merge multilple data values: in seperate columns as: js-1234 to .jpg Thanks Hi Jennifer, ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Hi Jennifer, Try using =(A1&B1) where A1 and B1 are the cells where your data sits ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ X-No-Archive: yes "Jennifer Burnel" <jenny@...

PJS2003
We have a couple plans that have their actual work values matching in the portfolio analyzer view. They stopped updating. They seem to be plans that were "saved as" another plan and then republished under the new name. Once the "Save as" another plan was completed, the olap work value stayed the same as the original plan's work value and did not continue updating with actual work reported. Is there a way to detached the "saved as" plan from it's original values in the OLAP cube? Example Project A has 5 hours total in Work on the Portfo...