+ Reply to Thread
Results 1 to 6 of 6

Capture Input Date

  1. #1
    Registered User
    Join Date
    04-08-2004
    Location
    U.K
    Posts
    17

    Question Capture Input Date

    Is there a way, either using a forumula or VB that I can capture the date a cell was modified ?
    Nothing is beyond our reach

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Use the following code:

    Private Sub Worksheet_Change(ByVal Target As Range)

    Set rng = Worksheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0)

    rng(1, 1) = Target.Address
    rng(1, 2) = Now()

    End Sub

    You will have to create a sheet where you need to save the data i.e. modified range and the date. In the above code, the sheet where this information is saved in Sheet2. This code has to be saved in the module for the sheet for which you want to find the cell modification dates. Suppose you want to do this for Sheet1. Right-click on the name tab of this sheet and click view code. Enter the above code, and you are ready.

    - Mangesh

  3. #3
    Registered User
    Join Date
    04-08-2004
    Location
    U.K
    Posts
    17
    Thats excellent but how do I get it to only check for modifications to a certain column, say column 'X' for example ?

  4. #4
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    To check for column B:

    Private Sub Worksheet_Change(ByVal Target As Range)

    if Target.Column = 2 then

    Set rng = Worksheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0)

    rng(1, 1) = Target.Address
    rng(1, 2) = Now()

    end if

    End Sub


    - Mangesh

  5. #5
    Registered User
    Join Date
    04-08-2004
    Location
    U.K
    Posts
    17
    Cheers !

    One final thing. DO you know how I could capture the user that input the data aswell ?

  6. #6
    Registered User
    Join Date
    04-08-2004
    Location
    U.K
    Posts
    17
    Never mind. Done it now.

+ 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