+ Reply to Thread
Results 1 to 6 of 6

Change reference to value upon save / state change

  1. #1
    Forum Contributor
    Join Date
    12-04-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    127

    Change reference to value upon save / state change

    Hello,

    Simple one I think but I just cant work it out

    I have cell B4 as: =IF(X10=1,W18,IF(X10=0,"input"&" "&"name"&" "&"first",""))

    X10is true/false for A4 which is NAME

    W18 is =TODAY()

    Once a name/text is entered into A4, I want B4 to turn to a value for saving purposes. So when the form is opened in future it shows the date it was created rather than todays date again.


    can anyone help?



    Thanks,

    Michael

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Change reference to value upon save / state change

    Hi,

    you would need a VBA macro to achieve that. Possible approach

    Hit alt-F11 to open the VBA editor and double click on ThisWorkbook in the navigation pane. Then copy this code into the code window

    Please Login or Register  to view this content.
    Change "Sheet1" to whatever your sheet name is.

    Now, before the workbook is saved, B4 will be copied and pasted as values only.

    hth

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Change reference to value upon save / state change

    I would just add that it's probably worth validating the value first just to be sure it's a date (and a formula if nec.), something like:

    Please Login or Register  to view this content.
    you could use formulae but it would need to be circular by nature and would therefore require Iteration be enabled - avoid if possible.

  4. #4
    Forum Contributor
    Join Date
    12-04-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    127

    Re: Change reference to value upon save / state change

    Thankyou that works great! But only 1 slight problem.

    This form is being created for ALL sales staff to use EVERY time they take a enquiry.

    How do I save it so, when someone opens the template file it has the formula waiting to go, then they save as because it is read only.


    sorry to be a pain.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Change reference to value upon save / state change

    if you turn on iteration tools/option/calculation check iteration
    you can use in b4
    =IF(X10=1,IF(OR(B4="input name first",B4=""),NOW(),B4),IF(X10=0,"input name first",""))
    then so long as x10 has 1 in it will hold the date
    hee hee
    you could use formulae but it would need to be circular by nature and would therefore require Iteration be enabled - avoid if possible.
    i just knew that was coming!
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Contributor
    Join Date
    12-04-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    127

    Re: Change reference to value upon save / state change

    thank you

    Quote Originally Posted by DonkeyOte View Post
    I would just add that it's probably worth validating the value first just to be sure it's a date (and a formula if nec.), something like:

    Please Login or Register  to view this content.
    you could use formulae but it would need to be circular by nature and would therefore require Iteration be enabled - avoid if possible.

+ 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