PC Review


Reply
Thread Tools Rate Thread

Automatically executing a macro when A pick list item is selected

 
 
=?Utf-8?B?S2VuIEs=?=
Guest
Posts: n/a
 
      30th Oct 2006
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 With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      30th Oct 2006
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need macro code to pick data according to year selected maniarasan Microsoft Excel Programming 1 27th Jul 2010 01:05 AM
Recording a macro to change item selected in drop down list Jen Microsoft Excel Worksheet Functions 3 8th Nov 2008 02:20 AM
Message from macro if a particular item on a list is selected Wendy Simes Microsoft Access Forms 2 1st Sep 2008 12:29 AM
Pick an item from a list... ctB Microsoft Access Reports 4 17th Jun 2007 09:18 PM
Dropdownlist as a pick list - setting the selected item =?Utf-8?B?UGF1bCBPd2Vu?= Microsoft Dot NET 0 16th Feb 2005 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:12 AM.