Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Running a macro from a conditional formula

I'd like to run one of two different macros I have created based on a Yes or
No answer in a cell. I've tryed the following formula:

=IF(K16="No", Macro "Closed", Macro "Not_Closed)

I was just guessing at the command to run a macro from a cell, but was not
correct.

Any help?

Thanks

JIM
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Running a macro from a conditional formula

hi,
not even close. formulas return values, they cannot perform actions like
call a macro. (also copy, paste, move, change color, phone home, ect)
but you can write a macro to do this. put it in the worksheet change event.
it might look something like this.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

If Range("B5").Value = "Y" Then
Call Macro1
Else
If Range("B5").Value = "N" Then
call macro2
End If
End If
End Sub

hope this gives you ideas.
good luck
regards
FSt1

"Jim" wrote:

I'd like to run one of two different macros I have created based on a Yes or
No answer in a cell. I've tryed the following formula:

=IF(K16="No", Macro "Closed", Macro "Not_Closed)

I was just guessing at the command to run a macro from a cell, but was not
correct.

Any help?

Thanks

JIM

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
conditional formatting: problem entering EOMONTH formula... Jonathan Cooper Excel Discussion (Misc queries) 1 February 6th 06 09:28 PM
Macro Formula Corey Excel Discussion (Misc queries) 1 February 4th 06 06:13 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Formula for current month minus one = Quarter number in a macro. Pank Excel Discussion (Misc queries) 11 June 22nd 05 02:47 PM


All times are GMT +1. The time now is 09:59 AM.

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"