Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 20
Default Embeddding a macro in Logical IF stmt

Hi

I am trying to embed a macro in a logical IF statement in the true result. Is this even possible, and if so how

Thanks for your help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Embeddding a macro in Logical IF stmt

Hi

Do you mean a IF statement in a formula or in code?

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron" wrote in message ...
Hi,

I am trying to embed a macro in a logical IF statement in the true result. Is this even possible, and if so how?

Thanks for your help!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Embeddding a macro in Logical IF stmt

Ron,

I guess that you mean a worksheet IF. You can, but the things that macro can
do are limited. It would need to be a function, and it can return a value,
but it cannot change any properties of the cell/worksheet.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ron" wrote in message
...
Hi,

I am trying to embed a macro in a logical IF statement in the true result.

Is this even possible, and if so how?

Thanks for your help!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Embeddding a macro in Logical IF stmt

Hi ron

You posted private that you use it in a formula
Try to use the calculate event in the Sheet module

This example will run the macro "YourMacroName" If the formula cell B1 display a value
higher then 10

Private Sub Worksheet_Calculate()
If Me.Range("b1").Value 10 Then
YourMacroName
Else
'do nothing
End If
End Sub

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi

Do you mean a IF statement in a formula or in code?

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron" wrote in message ...
Hi,

I am trying to embed a macro in a logical IF statement in the true result. Is this even possible, and if so how?

Thanks for your help!





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
LOOKUP or IF-THEN stmt - which one? JessP27 Excel Worksheet Functions 8 June 1st 09 04:51 PM
If Stmt with two colors kenny4golf Excel Worksheet Functions 1 December 14th 07 09:29 PM
Getting error using if then else stmt ub Excel Worksheet Functions 2 September 24th 07 10:48 PM
Rounding down from .9 in an IF stmt GenaM Excel Worksheet Functions 1 August 2nd 06 11:16 PM
URGENT need help with if/then stmt. Melissa H. Excel Worksheet Functions 4 October 26th 05 10:08 PM


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