Can use Naming replace Function?

  • Thread starter Cactus [ÏÉÈËÇò]
  • Start date
C

Cactus [ÏÉÈËÇò]

I just want to define a name of worksheet.
for replace below Function.

Public Function Between(Num As Long, Min As Long, Max As Long) As Boolean
If (Num >= Min) And (Num <= Max) Then
Between = True
End If
End Function
 
Y

yogendra.joshi

Yes, you can very much do it :)

When you are on cell D1, go to Menu -> Insert -> Name -> Define
give name as "bet" and refers to
"=between(Sheet1!A1,Sheet1!B1,Sheet1!C1)"

Now if you just type =bet in any cell, it will take the 3 cells becides
that cell and run your function.

Hope it helps.

~Yogendra
 
B

Bob Phillips

Why not just use

=between(5,Sheet2!A1,Sheet2!B1)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
C

Cactus [ÏÉÈËÇò]

"Bob Phillips"
Why not just use

=between(5,Sheet2!A1,Sheet2!B1)

In worksheet function, Between() function should that
=AND(A1>=B1,A1<=C1)

I want it ease type and readable for human.
 
B

Bob Phillips

Do you mean something like

Public Function Between(expr As String) As Boolean
Application.Volatile
Between = Evaluate(expr)
End Function


that would be used like this

=between("=AND(A1>=B1,A1<=C1)")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
C

Cactus [ÏÉÈËÇò]

"Bob Phillips"
Do you mean something like

Public Function Between(expr As String) As Boolean
Application.Volatile
Between = Evaluate(expr)
End Function


that would be used like this

=between("=AND(A1>=B1,A1<=C1)")

That is so far about Naming in worksheets.

May I explain that question.

It is Naming accept parameter?


Thank.
 
B

Bob Phillips

I am sorry, but I just don't understand.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top