You did not disable events prior to this:
So, for every cell in the used range of K:P, your sheet event fired many times. I doubt that you wanted that.![]()
Sheets("Sheet3").Range("k:p").Delete
You did not disable events prior to this:
So, for every cell in the used range of K:P, your sheet event fired many times. I doubt that you wanted that.![]()
Sheets("Sheet3").Range("k:p").Delete
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?
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
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..
i want to know, why this event triggers, when the original macro does not use the target column right?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks