Excel 2010 function to test if a cell has a formula or is input (number or text)

jerry12302

Active Member
Joined
Apr 18, 2005
Messages
456
Office Version
  1. 2010
Platform
  1. Windows
I use Excel 2010, I have been searching for a solution to determine whether a cell contains a formula of any kind, or is just hard input (value or text.)

Isformula is not included in Excel 2010, nor is any use of Hasformula.

I tried suggested UDF solutions, such as

Function IsFormula(cell_ref As Range)
IsFormula = cell_ref.HasFormula
End Function

None have worked, I get a #NAME? Error every time, and my workbook is saved as an xlsm, macro enabled. I placed the Function in a module, under General.

Has anyone found a solution that works in Excel 2010???
 
I get a #REF! error now
Unless you deleted the cell it was referring to, that shouldn't be possible. If other UDFs are also giving #NAME? errors, it suggests that macros are disabled for that workbook.
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Unless you deleted the cell it was referring to, that shouldn't be possible. If other UDFs are also giving #NAME? errors, it suggests that macros are disabled for that workbook.
I didn't delete the cell it was referring to. I deleted the formula and typed it again to be sure, referring to the cell J3, which has a value of 1 in it. I also tried it referring to cell J4, which has a formula, =J3+1

I keep getting #REF! errors.
Unless you deleted the cell it was referring to, that shouldn't be possible. If other UDFs are also giving #NAME? errors, it suggests that macros are disabled for that workbook.
Update, I checked named ranges. I don't remember naming any ranges, but there was a range name isformula. I deleted the range name, and now the function IsFormula works.

Weird.

Thank you for your help.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,217
Members
452,619
Latest member
Shiv1198

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top