Offset, 
Author Message
 Offset,

I have wrote a user defined function.

The code look somethin like this:

Function Crit_case(C1L, C1k1, C1Max, C2L, C2k1, C2Max)'the
actual code consist more of the same pattern arguements

CritMax=Application.WorksheetFunction.Max(C1Max, C2Max)
If CritMax = C1Max then
   Crit_case = C1L

ElseIF If CritMax = C2Max then
   Crit_case = C1L

EndIF
If



Tue, 08 Nov 2005 01:31:59 GMT  
 Offset,
I have wrote a user defined function.

The code look somethin like this:

Function Crit_case(C1L, C1k1, C1Max, C2L, C2k1, C2Max)'the
actual code consist more of the same pattern arguements

CritMax=Application.WorksheetFunction.Max(C1Max, C2Max)
If CritMax = C1Max then
   Crit_case = C1L

ElseIF If CritMax = C2Max then
   Crit_case = C1L

EndIF
End Function

I want to make Crit_case function cell, as the active
cell, so that I could offset to the cell below the
Crit_case function, and generate the corresponding C1k1
and C2k1 for if Crit_case = C1L and    Crit_case = C2L
respectively.

Thank you
Augustus



Tue, 08 Nov 2005 01:37:48 GMT  
 Offset,
I don't quite understand the function but I belive you can do what you want
using Application.Caller.

Function Test() as Long
    Application.Volatile '<- optional depending on calculation needs
    Test = Application.Caller.Offset(1).Row
End Function

returns a Long representing the row number one row down from the function
address.


Quote:
> I have wrote a user defined function.

> The code look somethin like this:

> Function Crit_case(C1L, C1k1, C1Max, C2L, C2k1, C2Max)'the
> actual code consist more of the same pattern arguements

> CritMax=Application.WorksheetFunction.Max(C1Max, C2Max)
> If CritMax = C1Max then
>    Crit_case = C1L

> ElseIF If CritMax = C2Max then
>    Crit_case = C1L

> EndIF
> End Function

> I want to make Crit_case function cell, as the active
> cell, so that I could offset to the cell below the
> Crit_case function, and generate the corresponding C1k1
> and C2k1 for if Crit_case = C1L and    Crit_case = C2L
> respectively.

> Thank you
> Augustus



Tue, 08 Nov 2005 01:59:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. if activecell.offset()=activecell.offset

2. How to prevent getting an error ModName: unknown ModVer: 0.0.0.0 Offset: 001e493a

3. Time stamp 6 hours offset

4. Passing arguments to my offset formula

5. Speed problem using Offset in VBA

6. Sum, Offset & Calculation

7. Offset

8. Offset function not defined problem

9. Following from the Find and offset problem

10. changing offset value in macro


 
Powered by phpBB® Forum Software © phpBB Group