View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Automatically executing a macro when A pick list item is selected

Give this a try. Right Click the sheet Tab and select view code. paste the
following.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then 'Change to suit
If Target.Value = "Yes" Then
MsgBox "Do the yes stuff!"
Else
MsgBox "Do the no stuff!"
End If
End If
End Sub
--
HTH...

Jim Thomlinson


"Ken K" wrote:

I have a pick list that only allows YES or NO. I wrote a VB macro that
performs various functions on the sheet, but can't figure out what to add to
the code to have it automatically execute when YES or NO is chosen.