+ Reply to Thread
Results 1 to 7 of 7

Add current date to a cell

  1. #1
    Forum Contributor
    Join Date
    12-31-2004
    Posts
    160

    Add current date to a cell

    Hi.

    I want to be able to to mark cell C2 with an "X" and have cell B2 display the current date And Cell A2 display "Ordered".

    I thought I had this working but the dates all change when the system date changes.

    Charles
    Last edited by VBA Noob; 04-06-2008 at 12:08 PM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon mrdata

    The shortcut combination to add todays date in a cell as a static (ir non changing) value is :
    Ctrl + ;

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor
    Join Date
    12-31-2004
    Posts
    160
    Quote Originally Posted by dominicb
    Good afternoon mrdata

    The shortcut combination to add todays date in a cell as a static (ir non changing) value is :
    Ctrl + ;

    HTH

    DominicB
    Well what I really wanted was for it to happen when the value x is in cell C2.
    You can't incorporate the shortcut in a funtion can you?

    Charles

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi mrdata

    Try putting this into a normal module :
    Please Login or Register  to view this content.
    Now this formula in A2 :
    =IF(C2="x","Ordered","")

    ...and this formula in B2 :
    =IF(C2="x",StaticDate(),"")

    HTH

    DominicB

  5. #5
    Forum Contributor
    Join Date
    12-31-2004
    Posts
    160

    Talking Works great!

    Quote Originally Posted by dominicb
    Hi mrdata

    Try putting this into a normal module :
    Please Login or Register  to view this content.
    Now this formula in A2 :
    =IF(C2="x","Ordered","")

    ...and this formula in B2 :
    =IF(C2="x",StaticDate(),"")

    HTH

    DominicB
    That works great! thank you so very much

    Charles

  6. #6
    Forum Contributor
    Join Date
    12-31-2004
    Posts
    160

    Thought it worked great but problem

    Quote Originally Posted by mrdata
    That works great! thank you so very much

    Charles
    I thought the code worked but now my dates are changing to the current date instead of staying static.
    When I change the system date the dates stay the same but somehow they changed by themselves.

    I can't replicate the problem or I would show you.

    Charles

  7. #7
    Forum Contributor
    Join Date
    12-31-2004
    Posts
    160

    I am having trouble with this code

    Quote Originally Posted by dominicb
    Hi mrdata

    Try putting this into a normal module :
    Please Login or Register  to view this content.
    Now this formula in A2 :
    =IF(C2="x","Ordered","")

    ...and this formula in B2 :
    =IF(C2="x",StaticDate(),"")

    HTH

    DominicB
    What would make the dates stay static on one computer but on another change as if no code was there.
    The same workbook is on two systems the code works fine on one but not the other both have the exact same version of office.

    Could it be a setting in excel?

    Charles

+ 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