VBA or function to test if cell contains a value or a formula?

EssKayKay

Active Member
Joined
Jan 5, 2003
Messages
402
Office Version
  1. 2007
Platform
  1. Windows
Is there a way to test if cell contains a value or a formula? I assume “=IsFormula()” but apparently I’m missing something. I’d like to either run this directly from VBA, something like either one of the following:

1. If B100 is formula (not a value) then do THIS otherwise do THAT.
2. If B100 is value (not a formula) then do THIS otherwise do THAT.

OR by placing the function in an adjacent cell to return YES or NO.

Thanks,
Steve
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Which version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’).

It looks like the IsFormula was introduced with Excel 2013 for Windows and Excel 2011 for Mac.
See here: ISFORMULA function - Microsoft Support
 
Upvote 0
Ah, thank you Joe. Yes, I am using an OLD version (2007) so I assume that is the problem. So short of that, is there any other work-around to deal with this on older versions?

Regarding my Account Details, I thought I had included that - my Bad, sorry.
 
Upvote 0
Ah, thank you Joe. Yes, I am using an OLD version (2007) so I assume that is the problem. So short of that, is there any other work-around to deal with this on older versions?

Regarding my Account Details, I thought I had included that - my Bad, sorry.
I have seen people make up their own function that does the same thing that the IsFormula function does. It is very short/simple code.
Here is a thread that has one you should be able to use: Excel IsFormula Function Alternative Formula
 
Upvote 0
Solution

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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