Ambiguous Name. Can A VBA Combine 2 MacrosNov 15, 2006
I've got two macros that work beautifully apart from one another ... but put the two in the same Excel workbook and they bump heads. I get the infamous "Ambiguous name detected: Worksheet_Change"
I know enough about VB to get myself into trouble. So, I'm asking for help from a talented person to show me how to combine the two ... or another work around to get through this.
Here are the two sets of code in my sheet that I think are causing the ambiguous name problem. How can I work around this error?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim varFind As Variant
If Target.Cells.Count > 1 Then Exit Sub
If Target.Column 2 And Target.Column 9 Then Exit Sub
If IsEmpty(Target) Then Target.Interior.ColorIndex = 0
If Target.Column = 2 Then
Set varFind = Columns(16).Find(What:=Target.Value, LookIn:=xlFormulas, LookAt:=xlWhole)
If varFind Is Nothing Then
Target.Interior.ColorIndex = 0
Target.Interior.ColorIndex = Cells(varFind.Row, 16).Interior.ColorIndex