VBA - multiple filters from clicking different cells

jh9940

New Member
Joined
Jul 18, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi

I successfully used the following code:

Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("I2")) Is Nothing Then
Call AR1_KS3
End If
End If
End Sub


I have multiple macros that filter data (school grades) e.g., Key Stage 3 - Academic Review 1. My problem is that whenever I add the same code again for another macro it doesn't work and I get the error message: Compile error: Ambiguous name detected: worksheet_selectionChange.

I've now learnt you can't have two of the same and I am not skilled enough to be able to write multiple macros within the same bit of code.

How can I have multiple macros assigned to different cells please?

Huge thanks in advance

JH
 
OK, that is really a new question altogether, as you are incorporating new procedures (even though it is the same project, it is a different question that your original).
As such, it is best to post that question to a brand new thread, so that it shows up on the "Unanswered threads" listing and other people will see it as a new unanswered question (and improve your chances of having it seen and answered). If you feel it is helpful, you can provide a link back to this question in your new question.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,223,996
Messages
6,175,864
Members
452,678
Latest member
will_simmo

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