+ Reply to Thread
Results 1 to 3 of 3

Need to rebuild formula using the value entered into a cell on the

  1. #1
    Forrest
    Guest

    Need to rebuild formula using the value entered into a cell on the

    I know this process can be done in VBA. I have done it. But using vba also
    requires that I have a mechanism to run the code. This would either be a
    timer, button, or event. However, I would like to, if possible, use the
    tools available in Excel to create this "Dynamic Equation."

    I have a DDE Server called IQLink. I need to create function for the DDE
    service. The service currently accepts equations in this format:
    =IQLink|NGF6!Last (give last traded price for natural gas for january 06)

    In cell A1, I have the Symbol (Manually Entered): NGF6

    I need to create the equation that will still work as an equation in a
    number of other cells based on that cell. Currently I have been able to make
    the string value using: ="=IQLink|" & A1 & "!Last"

    This equation results in: =IQLink|NGF6!Last in the cell, but the problem is
    obviously that I have created a string and now the service will not operate
    on it. I need to get this result, but in the format of an equation so that
    it will do the calculations using the DDE service.

    In case you are not familiar with DDE, I believe if you know the answer in a
    situation that is using a normal excel function, that would be helpful to me
    as well.

    I hope I have been descriptive enough. Thanks for the help.

  2. #2
    Gary''s Student
    Guest

    RE: Need to rebuild formula using the value entered into a cell on the

    This function may help you:


    Option Explicit
    Function Eval(s As String) As Variant
    With Application
    .Volatile
    Eval = .Evaluate(s)
    End With
    End Function

    so if you have in A1 =1+1 as a text string, then =Eval(A1) will return a 2
    --
    Gary''s Student


    "Forrest" wrote:

    > I know this process can be done in VBA. I have done it. But using vba also
    > requires that I have a mechanism to run the code. This would either be a
    > timer, button, or event. However, I would like to, if possible, use the
    > tools available in Excel to create this "Dynamic Equation."
    >
    > I have a DDE Server called IQLink. I need to create function for the DDE
    > service. The service currently accepts equations in this format:
    > =IQLink|NGF6!Last (give last traded price for natural gas for january 06)
    >
    > In cell A1, I have the Symbol (Manually Entered): NGF6
    >
    > I need to create the equation that will still work as an equation in a
    > number of other cells based on that cell. Currently I have been able to make
    > the string value using: ="=IQLink|" & A1 & "!Last"
    >
    > This equation results in: =IQLink|NGF6!Last in the cell, but the problem is
    > obviously that I have created a string and now the service will not operate
    > on it. I need to get this result, but in the format of an equation so that
    > it will do the calculations using the DDE service.
    >
    > In case you are not familiar with DDE, I believe if you know the answer in a
    > situation that is using a normal excel function, that would be helpful to me
    > as well.
    >
    > I hope I have been descriptive enough. Thanks for the help.


  3. #3
    Dave Peterson
    Guest

    Re: Need to rebuild formula using the value entered into a cell on the

    Since you're passing the string to your UDF, I think you could drop the
    ..volatile portion.



    Gary''s Student wrote:
    >
    > This function may help you:
    >
    > Option Explicit
    > Function Eval(s As String) As Variant
    > With Application
    > .Volatile
    > Eval = .Evaluate(s)
    > End With
    > End Function
    >
    > so if you have in A1 =1+1 as a text string, then =Eval(A1) will return a 2
    > --
    > Gary''s Student
    >
    > "Forrest" wrote:
    >
    > > I know this process can be done in VBA. I have done it. But using vba also
    > > requires that I have a mechanism to run the code. This would either be a
    > > timer, button, or event. However, I would like to, if possible, use the
    > > tools available in Excel to create this "Dynamic Equation."
    > >
    > > I have a DDE Server called IQLink. I need to create function for the DDE
    > > service. The service currently accepts equations in this format:
    > > =IQLink|NGF6!Last (give last traded price for natural gas for january 06)
    > >
    > > In cell A1, I have the Symbol (Manually Entered): NGF6
    > >
    > > I need to create the equation that will still work as an equation in a
    > > number of other cells based on that cell. Currently I have been able to make
    > > the string value using: ="=IQLink|" & A1 & "!Last"
    > >
    > > This equation results in: =IQLink|NGF6!Last in the cell, but the problem is
    > > obviously that I have created a string and now the service will not operate
    > > on it. I need to get this result, but in the format of an equation so that
    > > it will do the calculations using the DDE service.
    > >
    > > In case you are not familiar with DDE, I believe if you know the answer in a
    > > situation that is using a normal excel function, that would be helpful to me
    > > as well.
    > >
    > > I hope I have been descriptive enough. Thanks for the help.


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1