Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recording a macro to change item selected in drop down list Jen Excel Worksheet Functions 2 October 2nd 08 11:37 PM
List and subtotal selected items, then print separate item list TitanG Excel Worksheet Functions 0 September 8th 08 09:07 PM
How do I select more than one item from a drop down pick list? Greg Excel Discussion (Misc queries) 2 January 16th 08 10:43 PM
How do I select more than one item from a drop down pick list? Greg Excel Worksheet Functions 1 January 16th 08 03:08 PM
Last list item selected in a Multi-Select list box? Brian Excel Programming 3 December 5th 05 09:12 PM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"