Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts

    print value and formula (Excel 2003)

    How do I print the formula in one cell and the value in another cell on the same worksheet?

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: print value and formula (Excel 2003)

    If the formula does not change you could turn the formula into text by prefixing the formula with an apostrophe. Copy this line of text to another cell on the sheet or next to the cell containing the value.

    Regards,
    John

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: print value and formula (Excel 2003)

    You could put the following function in a module:

    Public Function GetFormula(oCell As Range)
    GetFormula = oCell.Formula
    End Function

    Say you have values and formulas in column A. Enter the following formula in B1:

    =GetFormula(A1)

    and fill down as far as needed. If you put the function in a module in your personal macro workbook Personal.xls, use

    =Personal.xls!GetFormula(A1)

Posting Permissions

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