![]() |
Automatically executing a macro when A pick list item is selected
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. |
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. |
All times are GMT +1. The time now is 12:34 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com