Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Macro run from If Then function

The goal is to run 'MacroX' if cell equals Y. Is that even possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Macro run from If Then function


"Nikki" wrote in message
...
The goal is to run 'MacroX' if cell equals Y. Is that even possible?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Macro run from If Then function

HI Nikki,
Add the following code the to Worksheet_Change() event on the worksheet
where the cell is located.

hth, Rick


Private Sub Worksheet_Change(ByVal Target as Range)
If Target.address = "$C$4" and Target.Value = "Y" Then ' <<
Change cell address
Call MacroX
End If
End Sub




"Nikki" wrote in message
...
The goal is to run 'MacroX' if cell equals Y. Is that even possible



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Macro run from If Then function

Hi, yes it is possible. Place this in the sheet module for the
worksheet you want to check for 'Y' value:

Private Sub Worksheet_Change(ByVal Target as Range)
'Test to see if change ocurred in Cell 'B2'
If Target.address(0,0) < "B2" Then exit sub
'Test if Cell B2 = "Y"
If Target.value = "Y" Then Call MacroX
End Sub

HTH-Lonnie M.

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
Macro with sum function RobRem Excel Worksheet Functions 1 April 25th 09 03:24 AM
Not sure what function, macro, etc to use Tony Excel Worksheet Functions 2 January 6th 08 06:10 PM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Macro Function HJ Excel Worksheet Functions 1 August 14th 06 02:44 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM


All times are GMT +1. The time now is 05:35 PM.

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"