+ Reply to Thread
Results 1 to 12 of 12

trigger event not functioning

Hybrid View

  1. #1
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: trigger event not functioning

    You did not disable events prior to this:
    Sheets("Sheet3").Range("k:p").Delete
    So, for every cell in the used range of K:P, your sheet event fired many times. I doubt that you wanted that.

  2. #2
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: trigger event not functioning

    Kenneth Sir,
    I am not able to get it exactly.. Can you tell me where should i modify, so that i want the macro to run..
    My purpose is to filter the range and copy through macro..
    Then by the event when the user inputs yes/no in the last visible row.. i want to copy it to another column
    How to change that both works fine..

    When the macro runs and stops at debug in thisworkbook.sheet3 line..
    Y is to so?

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: trigger event not functioning

    You have several issues going on. Which do you want to solve first?

    You lost me. For example, in Sheet3, I don't know what you are doing there. Please explain in words.

    You would save yourself a lot of effort if you would use Option Explicit at top of each object: worksheet, module, etc. Then in VBE's Debug menu, Compile before any Run.

    I made a few changes in Sheet3's BeforeDoubleclick code as commented and a bit more. Still, it really doesn't do anything in that sheet.

    'Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range)
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        Dim lastVisRow As Long, lastRow As Long, rng As Range
        
        'If Target.Column <> 11 Is Nothing Then Exit Sub
        If Target.Column <> 11 Then Exit Sub
        
        lastVisRow = Cells(Rows.Count, 10).End(xlUp).Row
        If Target.Column >= 11 And Target.Row = lastVisRow Then
            Cancel = True 'turn off edit in cell?
            Application.EnableEvents = False
            Selection.AutoFilter    'Selection? What is selected?
            Range("k1").AutoFilter 'Data is only in columns A:B, why filter K1?
            Range("j1:k" & lastRow).AutoFilter Field:=2, Criteria1:="yes" 'No data in those columns
            AutoFilter.Range.Offset(2, -1).Copy Destination:=Range("l1")
            Cells(1).AutoFilter
            Application.EnableEvents = True
        End If
    End Sub

  4. #4
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: trigger event not functioning

    Hi,
    my requirement is filter the school and copy the names corresponding axa/cxa/bxa and then asking the user whether user has completed updation so give yes/no for the same in a separate column .. then the yes are copied and no are deleted..


    For this , since i have not used input box or have limited knowledge in macro, hence i tried a msg box..
    first i filtered and copied the visible rows for the criteria to another column ..
    there in the next column, asked the user to input yes/no
    when last row is entered, either by change or doubleclick automatic copying of yes entries done..

    for this the trigger event was provided by forum user for another query, i modified to my requirement.. so i dont understand where i am going wrong..
    or am i totally wrong..

  5. #5
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: trigger event not functioning

    i want to know, why this event triggers, when the original macro does not use the target column right?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Event Trigger Not Working
    By stevewest012 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2018, 11:54 AM
  2. trigger an event if the cel value changes.
    By yoursamrit2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2015, 06:38 PM
  3. [SOLVED] VBA to trigger event change
    By jrholden in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-26-2014, 11:34 AM
  4. beforedoubleclick event does not trigger
    By anneman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2008, 11:49 AM
  5. Event trigger in Excel?
    By Tim Miller in forum Excel General
    Replies: 1
    Last Post: 05-24-2006, 04:10 PM
  6. [SOLVED] Event Trigger
    By lobo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2005, 04:35 PM
  7. [SOLVED] Trigger Event Code
    By Shawn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2005, 10:05 AM

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