+ Reply to Thread
Results 1 to 9 of 9

Cancelling a formula when a staic value is pulled

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    7

    Cancelling a formula when a staic value is pulled

    Hi,

    This is my first post on here so I hope I am in the right area.

    Basically I have created a formula using IF statements in Excel 2010 to pick up a value if a particular milestone have been achieved i.e. when 10, 20, 30 etc sales have been achieved pulled from the data source it is looking against bring back the detail in the respective cells.

    I have created this formula and its all working fine but I now need to amend it so that when the formula pulls a value (i.e. the cell is no longer blank) it becomes a static value rather than the formula. I know I could simply copy and paste special the values over this but need to automate this process. Basically I need it to be if you have a value (because of the formula) then become the static value but if not keep the formula.

    Is this something I could do in visual basic and if so how would I go about doing it? Or could I create a create a mirror image of the worksheet I am working on and say if you don't have a value i.e. a particular milestone has not been achieved, then keep the formula if not save as the static value. If this way can be do what formula would I need for that?

    Any help would be very helpful and hope I am clear

    Many thanks
    Ian

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Cancelling a formula when a staic value is pulled

    Hi,

    It would be easier to comment with certainty if we had the workbook to look at. A cell can only contain one thing at a time, either a formula or a constant. If you have some other variable that indicates when the formula should no longer change then it might be possible to use that in another IF function wrapped around your existing function.

    If not then to convert the formula to a value automatically would require an event driven macro. You'd need to decide what that event should be, could be a sheet change event, a particular sheet selection change event or several others, perhaps even a button that you clicked.

    I suggest you upload the workbook and show some before/after results and explain how the results are calculated.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    7

    Re: Cancelling a formula when a staic value is pulled

    Hi Richard

    thanks for your reply. This is probably a silly question but how do I go about uploading the workbook?

    Thanks
    Ian

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Cancelling a formula when a staic value is pulled

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    09-11-2014
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    7

    Re: Cancelling a formula when a staic value is pulled

    Hello,

    I have uploaded a sample workbook. Basically I need a macro to say if the formula which is in the cells picks up a set of new values then no longer be a formula but instead become a static value but the result of the formula in the worksheet.

    The Before worksheets show this i.e. there are formula in all the appropriate cells and the data values are less than the specified cell values for the formula but the AFTER worksheets show the formula still where the criteria can not be met but crucially also the 'hard keyed' static values which was pulled using the formula.

    Thank you
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Cancelling a formula when a staic value is pulled

    Hi,

    It would be easier to comment with certainty if we had the workbook to look at. A cell can only contain one thing at a time, either a formula or a constant. If you have some other variable that indicates when the formula should no longer change then it might be possible to use that in another IF function wrapped around your existing function.

    If not then to convert the formula to a value automatically would require an event driven macro. You'd need to decide what that event should be, could be a sheet change event, a particular sheet selection change event or several others, perhaps even a button that you clicked.

    I suggest you upload the workbook and show some before/after results and explain how the results are calculated.

  7. #7
    Registered User
    Join Date
    09-11-2014
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    7

    Re: Cancelling a formula when a staic value is pulled

    Just to clarify the after results are based on the formula which were in the cells in questions but as the values of the cells meet the criteria (of the formula) the cells change from being formula to static value whilst the rest of the formula in the worksheet/worksheet remain

    Thanks

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Cancelling a formula when a staic value is pulled

    Sorry, but that does nothing to clarify - at least to me.

    A picture is worth a thousand words so please upload the workbook with some manually created results and notes explaining how you have arrived at the results.

  9. #9
    Registered User
    Join Date
    09-11-2014
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    7

    Re: Cancelling a formula when a staic value is pulled

    Please see an attached example of the worksheet/macro I need help on
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Staic Date Stamp for adjacent cell being equal to "Dormant"
    By singerbatfink in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2014, 09:36 AM
  2. auto insert staic date with batch/export of data
    By ianmcw in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 12-03-2013, 12:33 AM
  3. [SOLVED] InputBox and cancelling
    By adamsc57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2009, 07:37 AM
  4. Cancelling Hyperlinks
    By nullGumby in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2006, 02:35 PM
  5. [SOLVED] Cancelling a macro
    By Naive in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2005, 12:06 PM

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