+ Reply to Thread
Results 1 to 4 of 4

Help with changing date automatically when cell value was changed.

Hybrid View

  1. #1
    Registered User
    Join Date
    06-02-2016
    Location
    Jerusalem, Israel
    MS-Off Ver
    2013
    Posts
    5

    Help with changing date automatically when cell value was changed.

    Hi everyone,

    i have a links tracking spread sheet, it has 3 columns: link, notes & date.

    whenever i'm changing the link/s i'm adding the date manually.

    since i'm changing the links very often, i wonder if there is a way to make the date change automatically whenever the link cell has changed?

    basically i need the "date" column to change to date the "link" column was changed.

    i hope that's clear enough, attaching a workbook to the post.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,311

    Re: Help with changing date automatically when cell value was changed.

    You would need a Worksheet Change event handler monitoring column A. When the data in column A changes, you can update the date in column C.

    You would need to save your workbook as macro enabled.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-02-2016
    Location
    Jerusalem, Israel
    MS-Off Ver
    2013
    Posts
    5

    Re: Help with changing date automatically when cell value was changed.

    Hi TMS,

    Sorry i'm a bit newbie to excel VBA.

    looked online how to do what you suggested and i'm a bit lost.

    found a VBA code that adds a note with the changed time to any changed cell, this is close but not what i want.

    VBA code:

    ' Add a comment for each change.
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim OldComment As String, NewComment As String, objCell As Range
        
        If Target.Cells.Count > 1 Then Exit Sub
        
        NewComment = "Changed on " & Now() & " by " & Application.UserName & _
            " from " & OldCellValue
        
        If Target.Comment Is Nothing Then
            Target.AddComment NewComment
        Else
            OldComment = Target.Comment.Text
            Target.Comment.Text NewComment & vbLf & OldComment
        End If
        
        Target.Comment.Shape.TextFrame.AutoSize = True
    
    End Sub
    how am i getting the data in the note to be written in the "date" cell?

    any tips on what to do it?

    Thanks!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,311

    Re: Help with changing date automatically when cell value was changed.

    Something like:

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Intersect(Columns(1), Target) Is Nothing Then Exit Sub
    If Target.Cells.Count > 1 Then Exit Sub
    
    Application.EnableEvents = False
    Target.Offset(, 2).Value = Date
    Application.EnableEvents = False
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Automatically changing the date when a cell changes value
    By Tristanfrontline in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-05-2014, 11:29 AM
  2. Replies: 7
    Last Post: 05-07-2014, 02:01 AM
  3. Need to cell to populate date automatically when another cell is changed
    By chrisernst1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2013, 07:46 PM
  4. Automatically change date when a cell value is changed
    By kdc1336 in forum Excel General
    Replies: 2
    Last Post: 08-12-2010, 12:09 AM
  5. Automatically changing cell value on a given date
    By plainlazy84 in forum Excel General
    Replies: 7
    Last Post: 10-13-2008, 05:10 PM
  6. [SOLVED] Changing Cell formats to date fields automatically
    By PCLIVE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-12-2005, 06:06 PM
  7. [SOLVED] How do I get a date changed automatically
    By AmyR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-24-2005, 10:06 AM

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