#1   Report Post  
Yves
 
Posts: n/a
Default Execute Macro

Hello,
Is there a way to execute a macro in a formula ??
For example a need to execute a macro if the value in a cell is out of
range.
Many thanks for your help
Yves



  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi

not directly, you can however, put worksheet change code against the sheet
to read the result of the formula and run appropriate code, e.g.
------
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" And Target.Value < 4 Then
Application.EnableEvents = False
Call Macro1
Application.EnableEvents = True
End If

End Sub

-------

if you'ld like help implementing something along these lines, please post
back with additional information

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Yves" wrote in message
...
Hello,
Is there a way to execute a macro in a formula ??
For example a need to execute a macro if the value in a cell is out of
range.
Many thanks for your help
Yves





  #3   Report Post  
Yves
 
Posts: n/a
Default

Hi,
Many thanks for your answer, it works very well
Regards.
Yves


"JulieD" a écrit dans le message de news:
...
Hi

not directly, you can however, put worksheet change code against the sheet
to read the result of the formula and run appropriate code, e.g.
------
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" And Target.Value < 4 Then
Application.EnableEvents = False
Call Macro1
Application.EnableEvents = True
End If

End Sub

-------

if you'ld like help implementing something along these lines, please post
back with additional information

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
...well i'm working on it anyway
"Yves" wrote in message
...
Hello,
Is there a way to execute a macro in a formula ??
For example a need to execute a macro if the value in a cell is out of
range.
Many thanks for your help
Yves








  #4   Report Post  
JulieD
 
Posts: n/a
Default

you're welcome and thanks for the feedback


"Yves" wrote in message
...
Hi,
Many thanks for your answer, it works very well
Regards.
Yves


"JulieD" a écrit dans le message de news:
...
Hi

not directly, you can however, put worksheet change code against the
sheet
to read the result of the formula and run appropriate code, e.g.
------
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" And Target.Value < 4 Then
Application.EnableEvents = False
Call Macro1
Application.EnableEvents = True
End If

End Sub

-------

if you'ld like help implementing something along these lines, please post
back with additional information

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
...well i'm working on it anyway
"Yves" wrote in message
...
Hello,
Is there a way to execute a macro in a formula ??
For example a need to execute a macro if the value in a cell is out of
range.
Many thanks for your help
Yves










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
Execute Macro automatically after hyperlink Bill Elerding Excel Discussion (Misc queries) 13 May 5th 05 01:01 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Executing macro for all worksheet from a different worksheet Biti New Users to Excel 3 December 8th 04 10:05 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


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