+ Reply to Thread
Results 1 to 9 of 9

Datestamp in cell that never changes

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Datestamp in cell that never changes

    Hi All,

    I have a VBA code that puts userinput from a userform to the next empty cell in kolom B on a specific worksheet.
    It works great but it should be very nice when a cell in kolom B is filled with userinput, the cell in kolom A shows the date of change.
    So if B1 changes from empty to --whatever data --, cell A1 shows the date from that day, when cell B2 changes, cell A2 shows the date.
    I now have the problem, when cell B1 changes, cell A1 is written correctly with the date but if the net day cell B2 changes, cell A2 shows the date but also cell A1 changes again.
    Probably because i'm using the NOW() code but I don't know for sure.
    How can I change my VBA code so the date is written only in the cell next to the cell that changes but also keeps this date and never changes again when other cells change ???

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Datestamp in cell that never changes

    Here is a way that does not use the =NOW() worksheet function:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Datestamp in cell that never changes

    Thx Jakobshavn,
    If I change the value of B1, the date of today is correctly written in cell A1 BUT....
    when I change the date of my system to a week later and write some data in cell B2, cel A2 is correctly filled woth the new date but also the date in cell A1 has changed !!
    I'm still facing the same problem, whenever a date is written into a cell, it changes the date to the actual date in all the cells.....

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Datestamp in cell that never changes

    Does A1 contain a formula or a Date constant?

  5. #5
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Datestamp in cell that never changes

    Jakobshavn,

    My error... Unfortunately the code doesn't work at all...
    I got a date in cell A1 because the cell itself contained the code:
    Please Login or Register  to view this content.
    I removed this code from the cell A1 and tested the VBA again but now it doesn't do anything...
    Do I put the code in the sheet or somewhere in the userform module ??

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Datestamp in cell that never changes

    We are making progress! Post the part of your code that actually puts values in column B. We can then amend your code to include my functionality!

  7. #7
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Datestamp in cell that never changes

    This is the line inside the userform that actually writes the user input to the next available cell on Sheet1 in kolom B
    Please Login or Register  to view this content.
    So this is not a VBA code on the sheet itself but the code inside the userform

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Datestamp in cell that never changes

    Try replacing your userform code with this:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-16-2012
    Location
    Almere
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Datestamp in cell that never changes

    I already tried this but then it also writes the date correctly but the next day all dates in kolom A change as soon as a new date is written...
    But with some experimenting I could make it work. I'm surprised it works but I don't worry about it.... it works !
    I simply put .value inside the line and that was all
    the code now looks like :
    Please Login or Register  to view this content.

+ 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