+ Reply to Thread
Results 1 to 3 of 3

Formular of one cell as text shown in another cell

  1. #1
    dan
    Guest

    Formular of one cell as text shown in another cell

    Suppose Cell B3 has a formular =Start!C3.
    I would want Cell D3 to have the text '=Start!C3 entered.
    It can be in formular or in VBA code.
    Thank you



  2. #2
    Niek Otten
    Guest

    Re: Formular of one cell as text shown in another cell

    ' =======================================
    Function ShowFormula(a As Range)
    ' Niek Otten
    ' March 31, 2006

    If Application.ReferenceStyle = xlR1C1 _
    Then ShowFormula = a.FormulaR1C1Local _
    Else: ShowFormula = a.FormulaLocal
    End Function
    ' =======================================

    ================================================
    Pasting a User Defined Function (UDF)
    Niek Otten, March 31, 2006

    If you find a VBA function on the Internet or somebody mails you one, and you don't know how to implement it, follow these
    steps:

    Select all the text of the function.
    CTRL+C (that is, press and hold down the CTRL key, press C, release both). This a shortcut for Copy.
    Go to Excel. Press ALT+F11 (same method: press and hold the ALT key, press the F11 key and release both). You are now in the
    Visual Basic Editor (VBE).
    From the menu bar, choose Insert>Module. There should now be a blank module sheet in front of you. Click in it and then
    press CTRL+V (same method.). This a shortcut for Paste. You should now see the text of the function in the Module.
    Press ALT+F11 again to return to your Excel worksheet.
    You should now be able to use the function as if it were a built-in function of Excel, like =SUM(..)
    ================================================



    --
    Kind regards,

    Niek Otten
    Microsoft MVP - Excel

    "dan" <[email protected]> wrote in message news:6VqGg.5598$6s.5296@trndny08...
    | Suppose Cell B3 has a formular =Start!C3.
    | I would want Cell D3 to have the text '=Start!C3 entered.
    | It can be in formular or in VBA code.
    | Thank you
    |
    |



  3. #3
    dan
    Guest

    Re: Formular of one cell as text shown in another cell

    This is great!
    Thank you very much, Niek

    "Niek Otten" <[email protected]> wrote in message
    news:uh%[email protected]...
    > ' =======================================
    > Function ShowFormula(a As Range)
    > ' Niek Otten
    > ' March 31, 2006
    >
    > If Application.ReferenceStyle = xlR1C1 _
    > Then ShowFormula = a.FormulaR1C1Local _
    > Else: ShowFormula = a.FormulaLocal
    > End Function
    > ' =======================================
    >
    > ================================================
    > Pasting a User Defined Function (UDF)
    > Niek Otten, March 31, 2006
    >
    > If you find a VBA function on the Internet or somebody mails you one,
    > and you don't know how to implement it, follow these
    > steps:
    >
    > Select all the text of the function.
    > CTRL+C (that is, press and hold down the CTRL key, press C, release
    > both). This a shortcut for Copy.
    > Go to Excel. Press ALT+F11 (same method: press and hold the ALT key,
    > press the F11 key and release both). You are now in the
    > Visual Basic Editor (VBE).
    > From the menu bar, choose Insert>Module. There should now be a blank
    > module sheet in front of you. Click in it and then
    > press CTRL+V (same method.). This a shortcut for Paste. You should now see
    > the text of the function in the Module.
    > Press ALT+F11 again to return to your Excel worksheet.
    > You should now be able to use the function as if it were a built-in
    > function of Excel, like =SUM(..)
    > ================================================
    >
    >
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    > Microsoft MVP - Excel
    >
    > "dan" <[email protected]> wrote in message
    > news:6VqGg.5598$6s.5296@trndny08...
    > | Suppose Cell B3 has a formular =Start!C3.
    > | I would want Cell D3 to have the text '=Start!C3 entered.
    > | It can be in formular or in VBA code.
    > | Thank you
    > |
    > |
    >
    >




+ 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