Worksheet_change only works on one worksheet. You need to copy this code
into each worksheet page you are going to use it for. when you view code,
you will see a project window on the left showing all the worksheets. You
havve to copy the code into each worksheet. double click on each sheet will
bring up a new VBA window where you can place the code.
"sike11 via OfficeKB.com" wrote:
I saw this code in an earlier posting:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col B
Application.EnableEvents = False
On Error GoTo enditall
If Target.Cells.Column = 2 Then
n = Target.Row
If Excel.Range("B" & n).Value < "" Then
Excel.Range("A" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub
I have made adjustments so that it can display the date and time in the
column I want. However,
I get an error which says "Argument not optional".
Please help. Also, would it be possible to adjust it so that it works across
multiple worksheets?
Thank you in advance.
This is sheet event code.
Right-click on the sheet tab and "View Code".
Copy/paste into that module.
Macros must be enabled by the user when opening the workbook for this code to
be
available.
--
Message posted via http://www.officekb.com