+ Reply to Thread
Results 1 to 5 of 5

formula through vb code

  1. #1
    Registered User
    Join Date
    01-27-2004
    Posts
    32

    formula through vb code

    Hi

    How to define a formula through vb code into excel range?

    //Thomas

  2. #2
    Tom Ogilvy
    Guest

    Re: formula through vb code

    Range("B10").Formula = "=Sum($B$1:$B$9)"

    --
    Regards,
    Tom Ogilvy


    "Jonsson" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    >
    > How to define a formula through vb code into excel range?
    >
    > //Thomas
    >
    >
    > --
    > Jonsson
    > ------------------------------------------------------------------------
    > Jonsson's Profile:

    http://www.excelforum.com/member.php...fo&userid=5472
    > View this thread: http://www.excelforum.com/showthread...hreadid=468654
    >




  3. #3
    Norman Jones
    Guest

    Re: formula through vb code

    Hi Thomas,

    Look at the 'FormulaR1C1 Property' and 'Formula Property' in VBA help and
    see also the examples provided,


    ---
    Regards,
    Norman



    "Jonsson" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi
    >
    > How to define a formula through vb code into excel range?
    >
    > //Thomas
    >
    >
    > --
    > Jonsson
    > ------------------------------------------------------------------------
    > Jonsson's Profile:
    > http://www.excelforum.com/member.php...fo&userid=5472
    > View this thread: http://www.excelforum.com/showthread...hreadid=468654
    >




  4. #4
    Mac Lingo
    Guest

    Re: formula through vb code: A solution

    Make up the range statement and then store it in the Excel Names Store.

    You put it in with
    ActiveWorkbook.Names("Name").Delete
    ActiveWorkbook.Names.Add Name:="Name", RefersToR1C1:=String
    where "Name" is the way you will reference it later.

    You can get it back with
    Temp = ActiveWorkbook.Names("Name").Value
    with a little tinkering to get off the "=" the quotes.

    Good luck,
    Mac Lingo



  5. #5
    Registered User
    Join Date
    01-27-2004
    Posts
    32
    Thanks, IŽll try that

    //Thomas

+ 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