Results 1 to 4 of 4

Timestamp

Threaded View

  1. #1
    Registered User
    Join Date
    11-29-2007
    Posts
    10

    Timestamp

    Hey guys,

    I have been working on this macro for a little while now, but need some help refining it. Basically, this is what I would like:

    Column B to be marked with the current date/time whenever any information is entered in Columns C through J. However, I do not want this to update every time. I only want it to be marked whenever the first information is entered.

    Also, I only want there to be a timestamp present if there is data in Columns C through J. If I delete the information in Columns C through J, I would like the timestamp to be removed.

    See below for my current macro:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Cell As Range
    For Each Cell In Target
    With Cell
    If .Column = Range("C:C").Column Then
    Cells(.Row, "B").Value = Now()
    End If
    End With
    Next Cell
    For Each Cell In Target
    With Cell
    If .Column = Range("D:D").Column Then
    Cells(.Row, "B").Value = Now()
    End If
    End With
    Next Cell
    For Each Cell In Target
    With Cell
    If .Column = Range("E:E").Column Then
    Cells(.Row, "B").Value = Now()
    End If
    End With
    Next Cell
    For Each Cell In Target
    With Cell
    If .Column = Range("F:F").Column Then
    Cells(.Row, "B").Value = Now()
    End If
    End With
    Next Cell
    For Each Cell In Target
    With Cell
    If .Column = Range("G:G").Column Then
    Cells(.Row, "B").Value = Now()
    End If
    End With
    Next Cell
    For Each Cell In Target
    With Cell
    If .Column = Range("H:H").Column Then
    Cells(.Row, "B").Value = Now()
    End If
    End With
    Next Cell
    End Sub
    Any ideas?

    Thanks,
    Chris
    Last edited by ctasich; 06-16-2010 at 11:23 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