Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following call to a VB Subroutine in my code:
=Gen_Note(A7) The only way I can get it to execute is to that I move my cursor to the particlar cell, hit the left mouse key twice, and hit return to calculate. I've tried copying the call into another line; that doesn't force it to make a call. <F9 doesn't get it to calculate either. What can I do? Thanks for your help, Mac |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I missed where you said you tried application.Volatile as the first line of
the function. I know you discussed this with Jerry Lewis, so I don't know if that is something you have tried or not. You can do a full recalc with Ctrl+Alt+F9 Another problem is that the function may result in an error if it isn't in the active cell - However, I would think you would get a #Value result in that case although I can't say for sure. -- Regards, Tom Ogilvy "Mac Lingo" wrote in message hlink.net... I have the following call to a VB Subroutine in my code: =Gen_Note(A7) The only way I can get it to execute is to that I move my cursor to the particlar cell, hit the left mouse key twice, and hit return to calculate. I've tried copying the call into another line; that doesn't force it to make a call. <F9 doesn't get it to calculate either. What can I do? Thanks for your help, Mac |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The problem is that there is difference between the Active Cell and the
Calling Cell. When you copy cells, the Active Cell seems to stay constant for every call. Use Calling_Address = Application.Caller.Address to figure out the actual calling address. Mac |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Guess you missed the point Mac.
I am well aware of application.caller. That says nothing for how your code is written, however. I suggested that a possible problem is that your function may only work when evaluated as the activecell. It is just a guess as you have faithfully hidden any nuance of your function. I imagine you will figure it out eventually. -- Regards, Tom Ogilvy "Mac Lingo" wrote in message hlink.net... The problem is that there is difference between the Active Cell and the Calling Cell. When you copy cells, the Active Cell seems to stay constant for every call. Use Calling_Address = Application.Caller.Address to figure out the actual calling address. Mac |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, you're right, Tom; the function only evaluates when called from the
active cell. My problem is that I need to know the row number that the function is being processed for, and I apparently only know how to get the row number of the active cell. One solution I can think of would be to move the whole process into a macro and take over row control explicitly. But is there a way to figure out the row number from the function? It make the coding much cleaner to do it this way. Thanks, Mac Lingo |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you show yourself how to do that
Application.Caller returns the address of the cell containing the formula. so just get the row of that cell Public Function MyFunction() Application.Volatile Dim rng1 as Range set rng1 = Application.Caller MyFunction = "I am located in row " & rng1.row End Function This should update each time the sheet calculates. -- Regards, Tom Ogilvy "Mac Lingo" wrote in message hlink.net... Yes, you're right, Tom; the function only evaluates when called from the active cell. My problem is that I need to know the row number that the function is being processed for, and I apparently only know how to get the row number of the active cell. One solution I can think of would be to move the whole process into a macro and take over row control explicitly. But is there a way to figure out the row number from the function? It make the coding much cleaner to do it this way. Thanks, Mac Lingo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I'm not sure what you'd call it, but is it possible to do this? | Excel Discussion (Misc queries) | |||
Call Center Management: How to calculate 'cost per call' | Excel Discussion (Misc queries) | |||
total work hours for 24 hour on-call schedules | Excel Discussion (Misc queries) | |||
Don't know what to call what I need? | Excel Worksheet Functions | |||
call sub | Excel Programming |