+ Reply to Thread
Results 1 to 4 of 4

Disabling worksheet_change when deleting rows . .

Hybrid View

Guest Disabling worksheet_change... 02-16-2006, 02:30 AM
Guest Re: Disabling... 02-16-2006, 02:55 AM
Guest Re: Disabling... 02-16-2006, 04:10 AM
Guest Re: Disabling... 02-16-2006, 12:10 PM
  1. #1
    Adam
    Guest

    Disabling worksheet_change when deleting rows . .

    Ok, Here's another one . .

    I am using Application.CutCopyMode = 0 and it properly disables the
    events inside worksheet_change()

    However, when I delete rows with the menu delete, it is triggering
    events in the worksheet_change() function in the sheet.

    How do I disable worksheet_change() when we delete rows?

    Thanks!
    Adam


  2. #2
    Tim Williams
    Guest

    Re: Disabling worksheet_change when deleting rows . .

    Maybe if
    Target.Columns.count = 256
    you could ignore the event. Not sure what your code is meant to catch, so
    that may or may not work in your case.

    Tim.

    "Adam" <Adam.Yakuvitz@gmail.com> wrote in message
    news:1140071241.240599.222140@f14g2000cwb.googlegroups.com...
    > Ok, Here's another one . .
    >
    > I am using Application.CutCopyMode = 0 and it properly disables the
    > events inside worksheet_change()
    >
    > However, when I delete rows with the menu delete, it is triggering
    > events in the worksheet_change() function in the sheet.
    >
    > How do I disable worksheet_change() when we delete rows?
    >
    > Thanks!
    > Adam
    >




  3. #3
    makkarm@gmail.com
    Guest

    Re: Disabling worksheet_change when deleting rows . .

    Hmm . . Can't see how I can make that work.

    I will elaborate on the problem. Here's what I need to do.

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Not Intersect(Target, Range("W:W")) Is Nothing Then
    If Application.CutCopyMode = 0 Then
    If <* Condition to check row deletes *> = 0 Then
    << Event >>
    End If
    End If
    End If

    I need to know how to write the <* Condition to check row deletes *>
    If a row is being deleted then don't trigger the event.

    Thanks!


  4. #4
    Tim Williams
    Guest

    Re: Disabling worksheet_change when deleting rows . .

    My suggestion was that if "Target" is a full row then don't do anything.

    If Target.Columns.Count=256 and Target.Rows.Count=1 then
    'do nothing
    else
    'event
    End If

    ....but since I'm not sure waht you're trying to track with the change event
    I can't know if that would work for you. Either deleting or inserting a row
    would hit the "do nothing"

    Tim.

    <makkarm@gmail.com> wrote in message
    news:1140076848.291857.162400@g43g2000cwa.googlegroups.com...
    > Hmm . . Can't see how I can make that work.
    >
    > I will elaborate on the problem. Here's what I need to do.
    >
    > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    > If Not Intersect(Target, Range("W:W")) Is Nothing Then
    > If Application.CutCopyMode = 0 Then
    > If <* Condition to check row deletes *> = 0 Then
    > << Event >>
    > End If
    > End If
    > End If
    >
    > I need to know how to write the <* Condition to check row deletes *>
    > If a row is being deleted then don't trigger the event.
    >
    > Thanks!
    >




+ 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