1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Changing Cell Info, Date tracks when cell changed

Discussion in 'Business Applications' started by canadianwrx, Mar 24, 2005.

Thread Status:
Not open for further replies.
Advertisement
  1. canadianwrx

    canadianwrx Thread Starter

    Joined:
    Mar 24, 2005
    Messages:
    5
    I want to have a range of cells store something. When one of those cells data is changed, I need another cell to show the date of when the cells data was changed automatically. For example: If Someone changes cell B2, A2 will show the date B2 was changed. Or B78 changes, A78 should show what date B78 changed. I need this to happen for the entire column. Is there a way to have this happen automatically? Please help, if you can.
     
  2. XL Guru

    XL Guru

    Joined:
    Aug 30, 2003
    Messages:
    2,702
    It's mainly a question of how bulletproof you need it.

    You could unlock all cells bar column A & then protect the sheet.

    (Cells are locked by default ; press CTRL+A to select the whole sheet, then Format -- Cells -- Protection & uncheck "Locked", click OK. Then select all of column A (CTRL+SpaceBar), then Format -- Cells -- Protection & check "Locked", click OK).

    Then use eg:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 2 Then Exit Sub
    ActiveSheet.Unprotect
    Target.Offset(0, -1) = Date
    ActiveSheet.Protect
    End Sub

    in the worksheet module.

    HTH,
    Andy
     
  3. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,685
    canadianwrx didn't the For/Next loop work?
     
  4. canadianwrx

    canadianwrx Thread Starter

    Joined:
    Mar 24, 2005
    Messages:
    5
    I talked to one of the programmers here at work. This is what he did and it works fine.

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Column = 10 Or Target.Column = 9 Then
    Cells(Target.Row, 8) = Date
    End If

    End Sub

    I appreciate your help though.
     
  5. XL Guru

    XL Guru

    Joined:
    Aug 30, 2003
    Messages:
    2,702
    >> This is what he did and it works fine.

    For sure. If it doesn't matter that the someone who changes the cell can straight off change or delete the date in column 8, then everyone's happy. I just have a thing about pointing out pitfalls.

    :),
    Andy
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/345402

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice