Advanced Filter by mouse click

SONART

New Member
Joined
Aug 18, 2010
Messages
43
Hi,

I'm new to VB and have copied a command which auto filters values on a separate worksheet ("Unique Acc"). This is trigerred by a drop down selection - change in value in a separate worksheet (SRA 1).

In the "SRA 1" worksheet, the command I have is:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 14 And Target.Column = 4 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("Raw Data 2").Range("O6").Calculate
Worksheets("Raw Data 2").Range("SRA_BRK_DATA") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Raw Data 2").Range("O5:O6"), _
CopyToRange:=Sheets("Unique Acc").Range("H6:I6"), Unique:=True

Is it possible to have this trigerred by a click instead, still driven by a target row and column location?

Is it possible to trigger the command above by both change in value and mouse click in the same worksheet?

Thanks in advance,
SONART
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You need to repeat the code in a different event:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
'your code goes here
'
End Sub
 
Upvote 0
I should have mentioned that after selecting from the drop down list(target colum & row in the command) selection which triggers the auto advance filter, there are other drop down selections and check boxes in my worksheet which the client have to select which also makes up the filter criteria. Rather than selecting the drop down list or target (column & row) selection again to trigger or "refresh" the auto advance filter. Is there a command which will do this? Ideally a macro command which will refresh my advance filter after the selections have been made.
 
Upvote 0
I was thinking of recording a macro to record the drop down list change to trigger the auto advance filter command after the client have made the change, and creating a button to assign the macro, perhaps label it as "Refresh". I tried recording the drop down list action but for some reason it doesn't work.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top