HI EVERYBODY
I am delighted to join you in this forum. I have a problem with the vba code , when I click a message tells me "Ambiguous name detected"
please can you help me?
thank you in advance
HI EVERYBODY
I am delighted to join you in this forum. I have a problem with the vba code , when I click a message tells me "Ambiguous name detected"
please can you help me?
thank you in advance
You can't have two same eventprocedure in 1 codemodulte:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$2:$E$2" Then
TextBox1 = ""
[a5].AutoFilter
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
remove 1 of these procedures.
I recommend that you only use Event Procedures to check conditions and select subs
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Condition1 Then SubA If Condition2 Then SubB End Sub
Or in your case
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$C$2:$E$2" Then ClearTextBox1 If Condition2 Then SubB End SubSub ClearTextBox1 TextBox1 = "" [a5].AutoFilter End SubSubB() ' ' End Sub
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ