Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default How to detect if a cell is formula

Hi

If a cell A1 contains the formula (for example, =SUM(K2:K1000) ),
Select a cell B1, from the formula menu, choose [Define Name].

In the Name box, type a name HASFORMULA and In the Refers To box,
type a formula =EVALUATE(GET.CELL(48,!A1)), and choose
the [Add] button and then [Close] button.

In a cell B1, enter the formula:

=HASFORMULA

--
Regards,

Soo Cheon Jheong
Seoul, Korea
http://excel.hompy.com
_ _
^ąŻ^
--


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default How to detect if a cell is formula

Better to create a UDF than rely on EVALUATE, as there is a serious problem
with EVALUATE.

The UDF would look like

Function HASFORMULA(rng As Range)
If rng.Count = 1 Then
HASFORMULA = rng.HASFORMULA
Else
HASFORMULA = CVErr(xlErrRef)
End If
End Function


--
HTH

-------

Bob Phillips
"Soo Cheon Jheong" wrote in message
...
Hi

If a cell A1 contains the formula (for example, =SUM(K2:K1000) ),
Select a cell B1, from the formula menu, choose [Define Name].

In the Name box, type a name HASFORMULA and In the Refers To box,
type a formula =EVALUATE(GET.CELL(48,!A1)), and choose
the [Add] button and then [Close] button.

In a cell B1, enter the formula:

=HASFORMULA

--
Regards,

Soo Cheon Jheong
Seoul, Korea
http://excel.hompy.com
_ _
^ąŻ^
--




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB ; How do I detect a Comment in a cell rdwj Excel Discussion (Misc queries) 5 June 4th 08 09:17 PM
Formula to detect color? [email protected] Excel Worksheet Functions 9 November 8th 06 12:53 AM
Detect Presence Formula Ken Excel Worksheet Functions 6 September 12th 06 06:43 PM
Need Formula to detect duplicate invoices XYZ via OfficeKB.com Excel Discussion (Misc queries) 1 October 11th 05 10:22 PM
How to detect if a cell is formula Frank Kabel Excel Programming 0 May 24th 04 07:48 AM


All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"