LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default How do you insert a macro into a formula?

This is from Chip Pearson's site, specifically:

http://www.cpearson.com/excel/differen.htm

" ...
Generally, you cannot call a macro directly from a worksheet cell. For
example, the following code does not work: =IF(A110,MyMacro).

You can simulate the statement =IF(A110,MyMacro) by using the
worksheet's Change event.

Private Sub Worksheet_Change (ByVal Target As Excel.Range)
If Target = [A1] Then
If Target.Value 10 Then
MyMacro
End If
End If
End Sub

...."

Hope this helps.

Pete

Swingstage wrote:

The answer to this question will also solve my problem so if there is a way
to place a macro into a formula please what is it?

"Obe" wrote in message
...
I wish to write a formula that goes to the end value in a column and uses
that value for multiplying another cell.

I am trying to multiply cell a7 by the last entry in the range c3:c20. I
have the macro that goes to that entry but now need the steps to insert it
into the formula. At the start of the month only cell c3 has data. On the
second day c4 has data and so on.

Thanks


 
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
Insert a Formula with a Macro Ed Excel Discussion (Misc queries) 2 October 22nd 06 11:37 PM
Macro to insert formula nobbyknownowt Excel Worksheet Functions 3 June 28th 06 05:16 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
Insert Line Macro Spyder Excel Discussion (Misc queries) 1 March 3rd 05 12:17 AM


All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"