View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] cemorganCO@gmail.com is offline
external usenet poster
 
Posts: 6
Default Excel code to call a macro when a certain value in a cell isselected.

On Feb 15, 12:14*pm, Gord Dibben <gorddibbATshawDOTca wrote:
How does C28 get to be "Remind"?

I will assume a calculated formula.

Private Sub Worksheet_Calculate()
*On Error GoTo stoppit
* *Application.EnableEvents = False
* *With Me.Range("C28")
* *If .Value = "remind" Then
* * * * * *Call Macroname
*End If
End With
stoppit:
Application.EnableEvents = True
End Sub

The is sheet event code. *Right-click on the sheet tab and "View Code"

Copy/paste into that module.

Gord Dibben *MS Excel MVP



On Fri, 15 Feb 2008 10:16:10 -0800 (PST), wrote:
I am trying to write code that will call a macro when the value of
cell is equal to a defined text.


Example:


If C28 *= "Remind", then Call Macro_Name.


Can anyone help?


Thanks!- Hide quoted text -


- Show quoted text -


Thanks Gord! That worked :)