+ Reply to Thread
Results 1 to 7 of 7

Date Function problem

  1. #1
    Registered User
    Join Date
    08-31-2005
    Posts
    2

    Question Date Function problem

    Ive set up a macro assigned to a button that inserts the date into the selected cell via the date function and then moves cursor one column to the right. When the date is inserted the cursor moves to cell to the right just fine.
    The problem is that when I use the macro to insert the date and time into another cell at a later time or date, all of the other dates change to the most recent one.

    Am i cra-z or should this not happen?

    Thanks

  2. #2
    Chip Pearson
    Guest

    Re: Date Function problem

    If you are inserting a formula, it will always update when a
    calculation is performed. To insert a static date, one that will
    not change, use code like


    ActiveCell.Value = Now


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "VW_****" <VW_****[email protected]>
    wrote in message
    news:VW_****[email protected]...
    >
    > Ive set up a macro assigned to a button that inserts the date
    > into the
    > selected cell via the date function and then moves cursor one
    > column to
    > the right. When the date is inserted the cursor moves to cell
    > to the
    > right just fine.
    > The problem is that when I use the macro to insert the date and
    > time
    > into another cell at a later time or date, all of the other
    > dates
    > change to the most recent one.
    >
    > Am i cra-z or should this not happen?
    >
    > Thanks
    >
    >
    > --
    > VW_****
    > ------------------------------------------------------------------------
    > VW_****'s Profile:
    > http://www.excelforum.com/member.php...o&userid=26847
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=400898
    >




  3. #3
    bigwheel
    Guest

    RE: Date Function problem

    What code does your macro use to insert the date? I tried Activecell = Date
    and it worked in the way you want i.e. the result is different if the date
    changes

    "VW_****" wrote:

    >
    > Ive set up a macro assigned to a button that inserts the date into the
    > selected cell via the date function and then moves cursor one column to
    > the right. When the date is inserted the cursor moves to cell to the
    > right just fine.
    > The problem is that when I use the macro to insert the date and time
    > into another cell at a later time or date, all of the other dates
    > change to the most recent one.
    >
    > Am i cra-z or should this not happen?
    >
    > Thanks
    >
    >
    > --
    > VW_****
    > ------------------------------------------------------------------------
    > VW_****'s Profile: http://www.excelforum.com/member.php...o&userid=26847
    > View this thread: http://www.excelforum.com/showthread...hreadid=400898
    >
    >


  4. #4
    RonaldF
    Guest

    RE: Date Function problem

    If you use this: ActiveCell.Value = Now

    It would not change the date/time, when you use it later on in a other cell.

    --
    Ronald Ferdinandus
    http://www.ro-pay.nl


    "VW_****" wrote:

    >
    > Ive set up a macro assigned to a button that inserts the date into the
    > selected cell via the date function and then moves cursor one column to
    > the right. When the date is inserted the cursor moves to cell to the
    > right just fine.
    > The problem is that when I use the macro to insert the date and time
    > into another cell at a later time or date, all of the other dates
    > change to the most recent one.
    >
    > Am i cra-z or should this not happen?
    >
    > Thanks
    >
    >
    > --
    > VW_****
    > ------------------------------------------------------------------------
    > VW_****'s Profile: http://www.excelforum.com/member.php...o&userid=26847
    > View this thread: http://www.excelforum.com/showthread...hreadid=400898
    >
    >


  5. #5
    RonaldF
    Guest

    RE: Date Function problem

    If you use this: ActiveCell.Value = Now

    It would not change the date/time, when you use it later on in a other cell.

    --
    Ronald Ferdinandus
    http://www.ro-pay.nl


    "VW_****" wrote:

    >
    > Ive set up a macro assigned to a button that inserts the date into the
    > selected cell via the date function and then moves cursor one column to
    > the right. When the date is inserted the cursor moves to cell to the
    > right just fine.
    > The problem is that when I use the macro to insert the date and time
    > into another cell at a later time or date, all of the other dates
    > change to the most recent one.
    >
    > Am i cra-z or should this not happen?
    >
    > Thanks
    >
    >
    > --
    > VW_****
    > ------------------------------------------------------------------------
    > VW_****'s Profile: http://www.excelforum.com/member.php...o&userid=26847
    > View this thread: http://www.excelforum.com/showthread...hreadid=400898
    >
    >


  6. #6
    Tom Ogilvy
    Guest

    Re: Date Function problem

    sounds like you are putting in the formula

    =Now()

    instead use the vba function now

    ActiveCell.Value = Now
    ActiveCell.offset(0,1).Select

    --
    Regards,
    Tom Ogilvy

    "VW_****" <VW_****[email protected]> wrote in
    message news:VW_****[email protected]...
    >
    > Ive set up a macro assigned to a button that inserts the date into the
    > selected cell via the date function and then moves cursor one column to
    > the right. When the date is inserted the cursor moves to cell to the
    > right just fine.
    > The problem is that when I use the macro to insert the date and time
    > into another cell at a later time or date, all of the other dates
    > change to the most recent one.
    >
    > Am i cra-z or should this not happen?
    >
    > Thanks
    >
    >
    > --
    > VW_****
    > ------------------------------------------------------------------------
    > VW_****'s Profile:

    http://www.excelforum.com/member.php...o&userid=26847
    > View this thread: http://www.excelforum.com/showthread...hreadid=400898
    >




  7. #7
    Registered User
    Join Date
    08-31-2005
    Posts
    2

    Talking

    Wow, thanks for all the replys.

    I used the code :

    ActiveCell.Value = Now

    ActiveCell.Offset(0, 1).Select

    and it works exactly how i need it to.

    Thanks to everyone for all the help

    Richard

+ 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