<code>Hi,
Having searched </code><code>MANY </code><code>previous threads I have finally found the following code that was submitted by phamtom1975 back in Dec 2003 and it works wonderfully, where if 1 is entered into A1 then the current date and time is put into E1.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If [A1] = "1" Then
'If A1 is formatted as text, then you will need to change "1" to "100%"
If [E1] = "" Then
[E1] = Now
End If
End If
End Sub
</code><code>Then, even if you delete the number in A1 the date and time will not change in E1 - great. Can anybody help me develop this, as I have never messed around with VB before to get it to allow me to use this same code across several worksheets</code><code>?
On each sheet (Laundry, Bars and Garbage) there are 5 rows with columns headed Name, Position and Date/Time. Therefore, on the Laundry sheet when somebody puts in their Name & Position, the Date/Time row will automatically insert the date & time. The same goes for rows 2 to 5 on this sheet, and for rows 1 to 5 on the remaining two sheets (i.e. Bars & Garbage).
If possible I would like to be able to have just the one formula to work with all 20 sheets that we use, as I have only used 3 worksheet titles as an example. Or, will I have to place smaller sections of code for each worksheet in the VB editor?
Any help you can give would be very much appreciated. Thanks
Graham
</code><code>
</code><code>
</code>
Having searched </code><code>MANY </code><code>previous threads I have finally found the following code that was submitted by phamtom1975 back in Dec 2003 and it works wonderfully, where if 1 is entered into A1 then the current date and time is put into E1.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If [A1] = "1" Then
'If A1 is formatted as text, then you will need to change "1" to "100%"
If [E1] = "" Then
[E1] = Now
End If
End If
End Sub
</code><code>Then, even if you delete the number in A1 the date and time will not change in E1 - great. Can anybody help me develop this, as I have never messed around with VB before to get it to allow me to use this same code across several worksheets</code><code>?
On each sheet (Laundry, Bars and Garbage) there are 5 rows with columns headed Name, Position and Date/Time. Therefore, on the Laundry sheet when somebody puts in their Name & Position, the Date/Time row will automatically insert the date & time. The same goes for rows 2 to 5 on this sheet, and for rows 1 to 5 on the remaining two sheets (i.e. Bars & Garbage).
If possible I would like to be able to have just the one formula to work with all 20 sheets that we use, as I have only used 3 worksheet titles as an example. Or, will I have to place smaller sections of code for each worksheet in the VB editor?
Any help you can give would be very much appreciated. Thanks
Graham
</code><code>
</code><code>
</code>