+ Reply to Thread
Results 1 to 4 of 4

Locking Date after using =Now()

  1. #1
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Locking Date after using =Now()

    I have a cell (A1) which has the formula =“Packing List - ”&Now(). I want the last part of cell A1 to show the date in dd/mm/yy format. It now only shows the date as a number. How do I do this? Using VBA is OK

    Thanks Sandy
    Last edited by gsandy; 04-04-2011 at 06:47 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Locking Date after using =Now()

    If you use TODAY() or NOW() functions in a cell in a formula, that formula will update to the current date/time every time you open the workbook or the workbook calculates. That means opening and printing this workbook a week from now will have next week's date on it.

    To still avoid VBA, you can do this, but it requires the use of a DROP DOWN in that cell so that you are effectively "selecting right now" from a text box, you still don't have to type in the cell and the value goes into the cell AS TEXT, so it won't update in the future unless you select the cell's drop down again and update the choice.

    HOW TO DO IT

    1) In an empty cell off to the right somewhere out of the way (AA1 for example), put this formula:

    =TODAY()

    2) Click on the cell type ThisDate into the Name Box, the box to the left of the formula bar that normally shows the cell you have selected.

    3) Now select the cells where you want this date to appear and open the Data > Validation window, use these settings:

    Allow: List
    Source: =ThisDate

    OK


    4) Now format those cells with a custom number format of:

    "Packing List - "dd/mm/yy


    That will do it. Just click on the cell, you will see today's date, click it and your permanent non-changing packing date will be entered.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Locking Date after using =Now()

    gsandy,

    Posted at the same time as JBeaucaire, so editing my post to remove the non-VBA part. The following is a macro you could use if you wanted to use VBA:

    Please Login or Register  to view this content.


    The macro will populate cell A1 with the required data and the date won't change as the day changes.

    Hope this helps,
    ~tigeravatar
    Last edited by tigeravatar; 04-04-2011 at 06:32 PM.

  4. #4
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Re: Locking Date after using =Now()

    Thanks for all the help, all working now. Sandy

+ 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