Results 1 to 16 of 16

Disable macro when inserting/deleting rows

Threaded View

  1. #1
    Registered User
    Join Date
    09-24-2009
    Location
    Middletown, CT
    MS-Off Ver
    Excel 2003
    Posts
    31

    Disable macro when inserting/deleting rows

    Hi,

    Is there a way for a macro to be not active when trying to insert a row or a way to have the macro understand that it's just a row shift? I'm trying to have a time stamp that anyone changes the value in a column. The following code generates an error 1004: application or object defined error when I insert or delete a row

    Private Sub Worksheet_Change(ByVal Target As Range)
    
        Dim cell As Range
    
        If Not Intersect(Target, Range("F1:F2000")) Is Nothing Then
            For Each cell In Target
                cell.Offset(0, -1) = Format(Now(), "mm/dd/yy HH MM AMPM")
            Next cell
        End If
    End Sub
    Last edited by aznprod517; 10-29-2009 at 09:41 AM.

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