+ Reply to Thread
Results 1 to 3 of 3

Date Stamp

  1. #1
    Registered User
    Join Date
    07-09-2005
    Posts
    1

    Date Stamp

    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

  2. #2
    Don Guillett
    Guest

    Re: Date Stamp

    for one thing your OR syntax must be repeated
    target.column=4 or target.column=10 or etc

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "newbie6182000" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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
    >
    >
    > --
    > newbie6182000
    > ------------------------------------------------------------------------
    > newbie6182000's Profile:

    http://www.excelforum.com/member.php...o&userid=25068
    > View this thread: http://www.excelforum.com/showthread...hreadid=385874
    >




  3. #3
    Bob Phillips
    Guest

    Re: Date Stamp

    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]...
    >
    > 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
    >
    >
    > --
    > newbie6182000
    > ------------------------------------------------------------------------
    > newbie6182000's Profile:

    http://www.excelforum.com/member.php...o&userid=25068
    > View this thread: http://www.excelforum.com/showthread...hreadid=385874
    >




+ Reply to Thread

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