+ Reply to Thread
Results 1 to 4 of 4

Freezing a value in a cell under certain condtion

Hybrid View

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    Essex
    MS-Off Ver
    Excel 2007
    Posts
    2

    Freezing a value in a cell under certain condtion

    Hi there.

    I want a value in a cell to freeze under a certain condition.

    E.G

    In cell 'A1' I have the item name, when that item sells I simply add a slash to the item name so it becomes 'Item/' that indicates a sold item to the rest of my excel calculations, in A2 is the price which it gets from my stock sheet, this price fluctuates often so one week it could £10 then next £11 etc.

    what i need simply is this: When A1 has 'Item/' (That is item sold) i want A2 not to updated anymore and the price to be frozen, otherwise the price i sold the item for continues to change well after i have sold it!

    At the moment I have to manually do it by just typing in the price of the item in A2 overwriting the formula that it uses.

    Any suggestions no matter how complicated are welcome.

    Thx in advance.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Freezing a value in a cell under certain condtion

    The formula should test for the
    =right(a1,1)<>"/"
    to act otherwise copy and paste as text the value at a2

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,427

    Re: Freezing a value in a cell under certain condtion

    I suspect the only way you can do that is with a Worksheet Change Event. When the cell being monitored has a "/" on the end, it would convert the formula to a value ... freezing it.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Freezing a value in a cell under certain condtion

    Hi HELLO2468,

    I agree with rcm and Trevor. See the attached file that implements what you requested. There are two sheets:
    a. Sheet 'Sheet1' which contains item name in Column 'A' and price in 'Column B'.
    b. Sheet 'StockSheet' which contains the Master Item List in 'Column A', and the current (volatile) price in Column 'B'.

    Instead of using a regular range for the Vlookup on the data in the 'StockSheet', I defined a 'Named Range 'myVookupRangeOnStockSheet', which makes using formulas and coding a little easier. To create a Named Range: Insert > Name > Define > xyz (then select range, then add)

    Lewis
    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] Summaty with condtion
    By yukioh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2012, 02:09 AM
  2. 6 condtion of if code function
    By Sam.K in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2008, 02:01 PM
  3. UserForm condtion does not work
    By helmekki in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-07-2007, 03:37 PM
  4. Sum by condtion
    By sqrlking in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2007, 01:36 PM
  5. Printing on condtion in message box?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2005, 10:39 PM

Tags for this Thread

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