ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is it a formula (https://www.excelbanter.com/excel-discussion-misc-queries/119928-formula.html)

Gizmo63

Is it a formula
 
Quick question.

Is there a VBA command that tests the activecell to see if it contains a
formula as opposed to actual text or number?
I've found tests for errors, dates, numbers, text etc.
You can test for "=" as it tests the value of the cell.

Prob really simple but I'm baffled.

Cheers
Giz

Ron Rosenfeld

Is it a formula
 
On Thu, 23 Nov 2006 06:45:02 -0800, Gizmo63
wrote:

Quick question.

Is there a VBA command that tests the activecell to see if it contains a
formula as opposed to actual text or number?
I've found tests for errors, dates, numbers, text etc.
You can test for "=" as it tests the value of the cell.

Prob really simple but I'm baffled.

Cheers
Giz



Function HasFormula(cell)
HasFormula = cell.HasFormula
End Function



--ron

Gizmo63

Is it a formula
 
Cheers Ron,
Sorted.
I was expecting an 'IS' test (ISDATE, ISERROR etc) not a 'HAS' test.



"Ron Rosenfeld" wrote:

On Thu, 23 Nov 2006 06:45:02 -0800, Gizmo63
wrote:

Quick question.

Is there a VBA command that tests the activecell to see if it contains a
formula as opposed to actual text or number?
I've found tests for errors, dates, numbers, text etc.
You can test for "=" as it tests the value of the cell.

Prob really simple but I'm baffled.

Cheers
Giz



Function HasFormula(cell)
HasFormula = cell.HasFormula
End Function



--ron


Ron Rosenfeld

Is it a formula
 
On Fri, 24 Nov 2006 04:43:02 -0800, Gizmo63
wrote:

Cheers Ron,
Sorted.
I was expecting an 'IS' test (ISDATE, ISERROR etc) not a 'HAS' test.




Glad to help.
--ron


All times are GMT +1. The time now is 04:10 AM.

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