Results 1 to 3 of 3

Automatically entering date into cell

Threaded View

  1. #1
    Registered User
    Join Date
    06-24-2010
    Location
    Newbury, England
    MS-Off Ver
    Excel 2003
    Posts
    19

    Automatically entering date into cell

    Hi All,

    I have created a spreadsheet to record a set of data and when a new record/line is added I would like to automatically enter today's date in the final column of the table to ensure that we know when that data was entered. I have written the code below to do this and initally it worked however it seems to have stopped now. I am unsure if there are any basic faults with the code or if there is a much better way of writing this.

    I would be very grateful for any advice or help received.
    Many thanks,
    C Jones


    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Target(1).Column = 5 Then
        Application.EnableEvents = False
        For Each cell In Target.Columns(1).Cells
            cell.Offset(0, 1).Value = Date
        Next
        Application.EnableEvents = True
    End If
    
    End Sub
    Last edited by CJ944; 06-25-2010 at 04:19 AM.

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