Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Excel macro activation.

Use the Change event of the worksheet, like this:

Private Sub Worksheet_Change(ByVal Target As Range)
'is changed cell in a certain region?
If Union(Range("A1:G10"), Target).Address _
= "$A$1:$G$10" Then
If Target.Cells(1).Value = "B" Then
MsgBox "Cell changed to B"
'other stuff here!
End If
End If
End Sub

Add the above code to the worksheet module.

Cheers,
Dave.
-----Original Message-----
Here is my problem.

I have a dropdown list in multiple cells that I've

created using data
validation feature. For example, my list contains 3

items: A,B,and C.
I also have a macro that I want to run but ONLY if the

user chooses
item B from the list. If he/she chooses either items A or

C, I don't
want the macro to run. Since my list contains words, I

don't know if
there's a way of triggering a macro with a keyword as

opposed to
attaching it to some sort of a button.

There are many rows that use this dropdown list and I was

trying to
see if there's a way of doing that without having to

create buttons.

I greatly appreciate any suggestions. Thanks.

Kate.
.

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
activation key LewisT Excel Discussion (Misc queries) 2 March 24th 10 05:27 AM
List activation on Excel bfbankpatrick Excel Worksheet Functions 1 February 4th 09 05:44 PM
ctrl-click hyperlink activation in excel MPH55a Excel Discussion (Misc queries) 1 September 23rd 05 07:24 PM
"combination drop-down edit " form activation in Excel Trev Excel Discussion (Misc queries) 1 March 4th 05 03:26 AM
Excel macro activation. Dick Kusleika Excel Programming 0 July 29th 03 04:47 PM


All times are GMT +1. The time now is 05:50 AM.

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

About Us

"It's about Microsoft Excel"