Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nevaeh
 
Posts: n/a
Default Can you enter a formula in a cell to run a macro?

Is there a way where I can enter a formula to run a macro? For example could
I enter a formula that say "if this value is greater than or equal to run
this macro".
  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default

A formula cannot run a macro.

Event code behind the worksheet could be used to run a macro when a cell
reaches a specific value.

Private Sub Worksheet_Calculate()
On Error GoTo enditall
Application.EnableEvents = False
If Range("$B$3").Value = 123 Then
ListColorIndexes
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on a sheet tab and "View Code"

Copy/paste the above in there.


Gord Dibben Excel MVP


On Mon, 14 Feb 2005 14:51:05 -0800, Nevaeh
wrote:

Is there a way where I can enter a formula to run a macro? For example could
I enter a formula that say "if this value is greater than or equal to run
this macro".


  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Jeez.........having a bad day.

"ListColorIndexes" will of course be adjusted to your macroname.


Gord

On Mon, 14 Feb 2005 15:26:29 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

A formula cannot run a macro.

Event code behind the worksheet could be used to run a macro when a cell
reaches a specific value.

Private Sub Worksheet_Calculate()
On Error GoTo enditall
Application.EnableEvents = False
If Range("$B$3").Value = 123 Then
ListColorIndexes
End If
enditall:
Application.EnableEvents = True
End Sub

Right-click on a sheet tab and "View Code"

Copy/paste the above in there.


Gord Dibben Excel MVP


On Mon, 14 Feb 2005 14:51:05 -0800, Nevaeh
wrote:

Is there a way where I can enter a formula to run a macro? For example could
I enter a formula that say "if this value is greater than or equal to run
this macro".


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
Formula to return cell contents based on multiple conditions Bill Excel Worksheet Functions 3 January 19th 05 09:59 AM
Cell shows formula and not the result of the formula. stumpy1220 Excel Worksheet Functions 2 January 14th 05 05:11 PM
I want the results of a formula to show in cell, NOT THE FORMULA! ocbecky Excel Discussion (Misc queries) 4 December 10th 04 08:39 PM
Formula window displays correct answer while cell displays incorre MMV Excel Worksheet Functions 3 November 10th 04 09:28 PM
Can you enter a formula in a cell that auto-inputs calculations a. proactive Excel Worksheet Functions 4 November 9th 04 05:00 AM


All times are GMT +1. The time now is 08:49 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"