Hi,
I have a spreadsheet that I use to forecast my workload, which requires users to fill in their requirements.
I am trying to add a date/time stamp to prevent the users from cheating by pretending they booked before they did.
I tried the following but it doesn't work (nothing appeared in column N when I made an entry in column G and saved).
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target
With Cell
If .Column = Range("G:G").Column Then
Cells(.Row, "N").Value = Now()
End If
End With
Next Cell
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
Does anybody know what I did wrong (bearing in mind my VB is elementary and that my existing knowledge is based on FAQ707-1657)? I followed FAQ707-1657, SkipVought's FAQ, How to Add a DateStamp in Excel, exactly. The only thing that confused me was point 2: it says "right click the sheet object you want the date stamp on" -- is there something missing here -- was I supposed to choose one of the resulting menus after right clicking?
Also, I've noticed that even though I selected Change in the procedure drop down box (and Worksheet in the object drop down menu), the procedure box now says SelectionChange).
Many thanks
Sam
I have a spreadsheet that I use to forecast my workload, which requires users to fill in their requirements.
I am trying to add a date/time stamp to prevent the users from cheating by pretending they booked before they did.
I tried the following but it doesn't work (nothing appeared in column N when I made an entry in column G and saved).
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target
With Cell
If .Column = Range("G:G").Column Then
Cells(.Row, "N").Value = Now()
End If
End With
Next Cell
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
Does anybody know what I did wrong (bearing in mind my VB is elementary and that my existing knowledge is based on FAQ707-1657)? I followed FAQ707-1657, SkipVought's FAQ, How to Add a DateStamp in Excel, exactly. The only thing that confused me was point 2: it says "right click the sheet object you want the date stamp on" -- is there something missing here -- was I supposed to choose one of the resulting menus after right clicking?
Also, I've noticed that even though I selected Change in the procedure drop down box (and Worksheet in the object drop down menu), the procedure box now says SelectionChange).
Many thanks
Sam