Date Stamp

  • Thread starter Thread starter newbie6182000
  • Start date Start date
N

newbie6182000

I have been trying to use this modified macro, but there seems to be a
problem with a debug error. In addition, how can I use this macro for
the whole workbook. Is there a way of copying a template worksheet and
rename it with a customer name and also put the entry in cell a1. Any
help will be great.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'a modification to the one written previously by Barrie Davidson
If Target.Column = 4 Or 10 Or 16 Or 22 Then
'If Target.Offset(0, -3).Cells = "" Then
Target.Offset(0, -3).Value = Now()
End If
'End If
End Sub

Original that seems to work

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Written by Barrie Davidson
If Target.Column = 4 Then
'If Target.Offset(0, -3).Cells = "" Then
Target.Offset(0, -3).Value = Now()
End If
'End If
End Sub
 
To make it applicable to the whole workbook, create the event procedure in
the ThisWorkbook code module, with a different first line

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)


--
HTH

Bob Phillips

"newbie6182000" <[email protected]>
wrote in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top