View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Compile error: Ambigious name detected: Worksheet_Change **NEWBIE**

Hi
This should work:
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Target.Address = "D5" Then
Range("c6:c24").Copy Range("c7:c25")
Range("c6").Value = Target.Value
ElseIf Target.Address = "Q5" Then
Range("p6:p24").Copy Range("p7:p25")
Range("p6").Value = Target.Value
End If
Application.EnableEvents = True
ws_exit:
Application.EnableEvents = True
End Sub

I don't see the need for the EnableEvents or error code?

regards
Paul