+ Reply to Thread
Results 1 to 4 of 4

A Value and a Formula result in the same cell

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    12

    A Value and a Formula result in the same cell

    Dear experts,
    I want to write a value in cell A1 and immediately when I will press Enter (or click outside the cell) I will receive a result of a formula that uses this value.
    This is trivial to do when you want the result of the formula in A2 or any other cell besides A1. The challenge is that I want the result of the formula in the same cell that I’ve placed the value (i.e. in A1).
    The formula itself doesn’t have to be written in the same cell, but I thought that the solution will be by using some kind of a cell format (that includes the formula). Anyway I couldn’t find a way how to do it.
    Appreciate very much if anyone can help me by instructing how to do it or by providing a VBA.
    Thanks very much,
    Yaron.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: A Value and a Formula result in the same cell

    You can either have a formula or a value in a cell, it isn't possible to have both.

    You can however simulate your conditions by using VBa and the Worksheet Change Event, where a formula could change the entered value to the desired value.
    This very simple code will multiply the value you enter in A1 by 5
    Please Login or Register  to view this content.
    Remember to use Application.EnableEvents = False at the beginning of the code and Application.EnableEvents = True at the end.
    Last edited by Marcol; 11-12-2012 at 07:25 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    12-06-2011
    Location
    Israel
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: A Value and a Formula result in the same cell

    Thank you very much Marcol. It seems to be the code that I was looking for.
    Regards,
    Yaron.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: A Value and a Formula result in the same cell

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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