#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default On Action?

Thanks, and I did something similar

"CWillis" wrote:

I use a list box in a program. When something is selected from the box, a
macro is run. Here is the code. I hope this helps:

'This sub runs when cell G7 is changed.
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Range("G7"), Target) Is Nothing Then Exit Sub
Const WS_RANGE As String = "G7"

Application.EnableEvents = False
If Range("G7").Value = "listboxoption1" Then
Range("M7").Value = " "
Range("M8").Value = " "
ElseIf Range("G7").Value = "listboxoption2" Then
Range("M7").Value = "typetexthere"
Range("M8").Value = " "
ElseIf Range("G7").Value = "listboxoption3" Then
Range("M7").Value = "typetexthere"
Range("M8").Value = " "
ElseIf Range("G7").Value = "listboxoption4" Then
Range("M7").Value = "typetexthere"
Range("M8").Value = "typetexthere"
End If
Application.EnableEvents = True

End Sub

"John" wrote:

I want to run a macro after the cell B7 is edited... currently the cell is a
DATAvalidationlist Does it need to be a Listbox?

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
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
On Action Greg Wilson Excel Programming 0 March 26th 06 11:51 PM
what is an OLE action funkymonkUK[_65_] Excel Programming 2 August 31st 05 12:31 PM
OLE action? choice[_2_] Excel Programming 1 February 27th 05 06:10 PM


All times are GMT +1. The time now is 09:03 AM.

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"