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

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

 Page 1 of 1 [ 3 post ]

Relevant Pages