Can use Naming replace Function?

  • Thread starter Thread starter =?gb2312?B?Q2FjdHVzIFvPycjLx/Jd?=
  • Start date Start date
?

=?gb2312?B?Q2FjdHVzIFvPycjLx/Jd?=

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
 
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
 
Why not just use

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

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
"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.
 
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)
 
"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.
 
I am sorry, but I just don't understand.

--

HTH

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