Hi,
It seems like a trivial thing, but I seem to be unable to locate a worksheet
function that allows me to determine, if a given cell contents is a formula
or a value.
Thank you!
You can use a custom function like:
Function IsFormula(rng1 As Range) As Boolean
IsFormula = rng1.HasFormula
End Function
Also, you can see it directly on the screen using CTRL ~
Hope this helps,
Miguel.
quot;J.Smithquot; wrote:
gt; Hi,
gt; It seems like a trivial thing, but I seem to be unable to locate a worksheet
gt; function that allows me to determine, if a given cell contents is a formula
gt; or a value.
gt;
gt; Thank you!
gt;
gt;
gt;
J.Smith wrote:
gt; It seems like a trivial thing, but I seem to be unable to locate a worksheet
gt; function that allows me to determine, if a given cell contents is a formula
gt; or a value.
Try the F5* gt; Special route (options are available there)
*or click Edit gt; Go to.. , or Press Ctrl G
Press F5 gt; Special gt; Check quot;Formulasquot; gt; OK
will select all formula cells on the sheet at one go
Then we could apply Format gt; Cells gt; Font tab (to taste)
Similarly, we could also select the constants:
Press F5 gt; Special gt; Check quot;Constantsquot; gt; OK
then apply format to taste, etc ...
--
Max
Singapore
savefile.com/projects/236895
xdemechanik
---
Hi,
Another option that you may be interested in is colouring cell contents
based on what sort of info they contain eg formula, constant, inputs
etc. If so, check out Aaron's colour code macro:
www.xl-logic.com/xl_files/vba/color_code.zip
which is listed on his page:
www.xl-logic.com/pages/vba.html
hth
Rob Brockett
NZ
Always learning amp; the best way to learn is to experience...--
broro183
------------------------------------------------------------------------
broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
View this thread: www.excelforum.com/showthread...hreadid=543604
gt; Another option that you may be interested in is colouring cell contents
gt; based on what sort of info they contain eg formula, constant, inputs
gt; etc. If so, check out Aaron's colour code macro:
gt; www.xl-logic.com/xl_files/vba/color_code.zip
gt; which is listed on his page:
gt; www.xl-logic.com/pages/vba.html
gt;
gt; hth
gt; Rob Brockett
gt; NZ
Thanks, Rob! This is exactly the purpose I need it for. I want to use a
formula which detects if a formula is used in a current cell, in order to
apply conditional formatting, so those cells with formula would show up
differently (and the user would have a choice to either overwrite them with
values, or leave them with calculated defaults).
Thank you for your reply!
gt; You can use a custom function like:
gt; Function IsFormula(rng1 As Range) As Boolean
gt; IsFormula = rng1.HasFormula
gt; End Function
gt;
gt; Also, you can see it directly on the screen using CTRL ~
gt;
gt; Hope this helps,
gt; Miguel.
Thank you, Miguel! I was hoping, there would be a spreadsheet function, but
looks like there is none. If that's the case, then, of course, a VB function
is the last resort.
Thanks, again, for your reply.
Thanks, Max, but I was looking for a worksheet function which does that.
Thanks for replying, anyway!
gt; Try the F5* gt; Special route (options are available there)
gt; *or click Edit gt; Go to.. , or Press Ctrl G
gt;
gt; Press F5 gt; Special gt; Check quot;Formulasquot; gt; OK
gt; will select all formula cells on the sheet at one go
gt; Then we could apply Format gt; Cells gt; Font tab (to taste)
gt;
gt; Similarly, we could also select the constants:
gt; Press F5 gt; Special gt; Check quot;Constantsquot; gt; OK
gt; then apply format to taste, etc ...
gt;
gt; --
gt; Max
gt; Singapore
gt; savefile.com/projects/236895
gt; xdemechanik
gt; ---
gt;
J.Smith wrote:
gt; Thanks, Max, but I was looking for a worksheet function which does that.
gt; Thanks for replying, anyway!
No prob, was just venturing a guess as to your underlying intent.
Thanks for the feedback ..
--
Max
Singapore
savefile.com/projects/236895
xdemechanik
---
Hi
Thanks for the feedback, pleased I could help.
I hope it works as you want/expect it to - from memory, it permanently
overwrites the other formatting that you have on your sheets.
Rob Brockett
NZ
Always learning amp; the best way to learn is to experience...--
broro183
------------------------------------------------------------------------
broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
View this thread: www.excelforum.com/showthread...hreadid=543604J.Smith wrote...
gt;It seems like a trivial thing, but I seem to be unable to locate a worksheet
gt;function that allows me to determine, if a given cell contents is a formula
gt;or a value.
No built-in function to do this. You could use VBA to write a
user-defined function. UDFs need to go into general VBA modules, not
class modules.
Function isformula(r As Range) As Boolean
isformula = r.Cells(1).HasFormula
End Function
- Nov 18 Sat 2006 20:10
Function: cell contents formula or value?
close
全站熱搜
留言列表
發表留言