ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   20 minutes trying... (https://www.excelbanter.com/excel-programming/341781-20-minutes-trying.html)

Jim May

20 minutes trying...
 
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!



Bob Phillips[_12_]

20 minutes trying...
 
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!




Jim Thomlinson[_4_]

20 minutes trying...
 
It works fine for me. Just to confirm the code is in a regular module "Module
1" (or the like) and not in the sheet or in "ThisWorkbook".
--
HTH...

Jim Thomlinson


"Jim May" wrote:

With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!




Gary Keramidas[_4_]

20 minutes trying...
 
this works for me

Private Function IsFormula(cell As Range) As Integer
If cell.HasFormula Then
IsFormula = 1
Else
IsFormula = 0
End If
End Function

--


Gary


"Jim May" wrote in message news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!




Dave Peterson

20 minutes trying...
 
Were you playing with named ranges beforehand? Did you create one named
IsFormula?

Any chance your module name is IsFormula (as well as the function name)?



Jim May wrote:

With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!


--

Dave Peterson

Jim May

20 minutes trying...
 
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!






[email protected]

20 minutes trying...
 
try:
Function IsFormula(cell As Range) As Boolean
If Cell.HasFormula Then
IsFormula = True
Else
Is Formula = False
End If
End Function


Tom Ogilvy

20 minutes trying...
 
As Jim said, put it in a general module, not the sheet module.

--
Regards,
Tom Ogilvy

"Jim May" wrote in message news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!








Jim May

20 minutes trying...
 
OK, everything before now was based on my having the Isformula() in my
Personal.xls file. << where it wasn't working!!

I just copied the complete function into a std module of the subject
workbook, And it Worked !!

What's the difference? Does this prompt a reaction?
TIA,,,
Jim

"Jim May" wrote in message news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!








Dave Peterson

20 minutes trying...
 
=personal.xls!isformula(a4)


Jim May wrote:

OK, everything before now was based on my having the Isformula() in my
Personal.xls file. << where it wasn't working!!

I just copied the complete function into a std module of the subject
workbook, And it Worked !!

What's the difference? Does this prompt a reaction?
TIA,,,
Jim

"Jim May" wrote in message news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!






--

Dave Peterson

Jim May

20 minutes trying...
 
HooRay!!!
Is this always the rule (prefacing with =personal.xls!)?
Tks Dave,
Jim

"Dave Peterson" wrote in message
...
=personal.xls!isformula(a4)


Jim May wrote:

OK, everything before now was based on my having the Isformula() in my
Personal.xls file. << where it wasn't working!!

I just copied the complete function into a std module of the subject
workbook, And it Worked !!

What's the difference? Does this prompt a reaction?
TIA,,,
Jim

"Jim May" wrote in message
news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!






--

Dave Peterson




Myrna Larson

20 minutes trying...
 
No, it's not always the rule. If you go to the VB Editor, select your
workbook, then go to Tools/References and put a check mark in front of
Personal.xls, then you don't have to precede the function name with
personal.xls!

On Mon, 3 Oct 2005 22:19:35 -0400, "Jim May" wrote:

HooRay!!!
Is this always the rule (prefacing with =personal.xls!)?
Tks Dave,
Jim

"Dave Peterson" wrote in message
...
=personal.xls!isformula(a4)


Jim May wrote:

OK, everything before now was based on my having the Isformula() in my
Personal.xls file. << where it wasn't working!!

I just copied the complete function into a std module of the subject
workbook, And it Worked !!

What's the difference? Does this prompt a reaction?
TIA,,,
Jim

"Jim May" wrote in message
news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!






--

Dave Peterson



Jim May

20 minutes trying...
 
Never mind, I figured it out;
Needed to change Name from "VBA Project" to "Personal"
under properties.


"Jim May" wrote in message news:9dt0f.95$jw6.93@lakeread02...
Thanks Myrna, I was thinking that I'd seen or done this without the
preface "=personal.xls".
Jim

"Myrna Larson" wrote in message
...
No, it's not always the rule. If you go to the VB Editor, select your
workbook, then go to Tools/References and put a check mark in front of
Personal.xls, then you don't have to precede the function name with
personal.xls!

On Mon, 3 Oct 2005 22:19:35 -0400, "Jim May" wrote:

HooRay!!!
Is this always the rule (prefacing with =personal.xls!)?
Tks Dave,
Jim

"Dave Peterson" wrote in message
...
=personal.xls!isformula(a4)


Jim May wrote:

OK, everything before now was based on my having the Isformula() in my
Personal.xls file. << where it wasn't working!!

I just copied the complete function into a std module of the subject
workbook, And it Worked !!

What's the difference? Does this prompt a reaction?
TIA,,,
Jim

"Jim May" wrote in message
news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!






--

Dave Peterson






Tom Ogilvy

20 minutes trying...
 
Or make personal.xls an addin.

--
Regards,
Tom Ogilvy

"Jim May" wrote in message news:9dt0f.95$jw6.93@lakeread02...
Thanks Myrna, I was thinking that I'd seen or done this without the

preface
"=personal.xls".
Jim

"Myrna Larson" wrote in message
...
No, it's not always the rule. If you go to the VB Editor, select your
workbook, then go to Tools/References and put a check mark in front of
Personal.xls, then you don't have to precede the function name with
personal.xls!

On Mon, 3 Oct 2005 22:19:35 -0400, "Jim May" wrote:

HooRay!!!
Is this always the rule (prefacing with =personal.xls!)?
Tks Dave,
Jim

"Dave Peterson" wrote in message
...
=personal.xls!isformula(a4)


Jim May wrote:

OK, everything before now was based on my having the Isformula() in

my
Personal.xls file. << where it wasn't working!!

I just copied the complete function into a std module of the subject
workbook, And it Worked !!

What's the difference? Does this prompt a reaction?
TIA,,,
Jim

"Jim May" wrote in message
news:Nkj0f.79$jw6.35@lakeread02...
A1:A3 contains 123, 234, 345 respectfully
A4 displays 702 ( = Sum(A1:A3))
B4 = = Isformula(A4) -- Displaying #Name?

Did I indicate #VALUE? before.. CRAP yes
I should have indicated #Name? this is what's
being displayed..
Sorry,



"Bob Phillips" wrote in message
...
Works fine for me Jim.

Does the range A1:A3 have anything odd i it?
Does A4 sum to the correct value?

"Jim May" wrote in message
news:LYi0f.67$jw6.44@lakeread02...
With the following in a standard module:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

In cell A4 of sheet1 there is a formula = Sum(A1:A3)
In cell B4 I have =IsFormula(A4) -- Displaying #Value?

I've search google, etc..
CRAP!!






--

Dave Peterson







All times are GMT +1. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com