Hi I am new to Macros and sorry if was unable to explain my doubt clearly.
I am creating a excel for customer support.
It has an drop down option in cell "C5" with values like "Inquiry","Cancel","General". So when user selects an option a specific shape (like the one in "INSERT - SHAPES") appears until now it is fine.
The problem is i want to create a similar type of option in Cell "C10". so i copy, pasted and edited the same but when i try to change the value in "C5" i am getting an error As "Compile Error : Ambiguous name detected : Worksheet-change"
"I know that it is saying as the name cannot be the same but when i change it the Macros is not working"
Below is the code i used :
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C5")) Is Nothing Then Exit Sub
If Target.Value = "Inquiry" Then
Sheet3.Shapes("Oval 2").Visible = True
Sheet3.Shapes("Oval 1").Visible = False
Sheet3.Shapes("Oval 3").Visible = False
End If
If Target.Value = "Cancel" Then
Sheet3.Shapes("Oval 1").Visible = True
Sheet3.Shapes("Oval 2").Visible = False
Sheet3.Shapes("Oval 3").Visible = False
End If
If Target.Value = "General" Then
Sheet3.Shapes("Oval 3").Visible = True
Sheet3.Shapes("Oval 2").Visible = False
Sheet3.Shapes("Oval 1").Visible = False
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C9")) Is Nothing Then Exit Sub
If Target.Value = "Inquiry" Then
Sheet3.Shapes("Rectangle 1").Visible = True
Sheet3.Shapes("Rectangle 2").Visible = False
Sheet3.Shapes("Rectangle 3").Visible = False
End If
If Target.Value = "Cancel" Then
Sheet3.Shapes("Rectangle 2").Visible = True
Sheet3.Shapes("Rectangle 1").Visible = False
Sheet3.Shapes("Rectangle 3").Visible = False
End If
If Target.Value = "General" Then
Sheet3.Shapes("Rectangle 3").Visible = True
Sheet3.Shapes("Rectangle 2").Visible = False
Sheet3.Shapes("Rectangle 1").Visible = False
End If
End Sub
Display More
Also can this code be run from Module ??
Thanks in advance !!