View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joel[_136_] joel[_136_] is offline
external usenet poster
 
Posts: 1
Default Choose box, put cell contents, update


the macro is being called twice because when you change G6 is causes a
2nd event of the macro to occur. disableEvent should solve the problem.
I also made some improvements to the code.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$L$11" And Target.Count = 1 Then
Application.EnableEvents = False
Select Case Target.Value

Case 1:
Range("G6") = "Cat"
Case 2:
Range("G6") = "Dog"
Case 3:
Range("G6") = "Fish"
End Select
Application.EnableEvents = False
End If
End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=149424