PC Review


Reply
Thread Tools Rate Thread

How to check if a certain function is used

 
 
IgorM
Guest
Posts: n/a
 
      25th Feb 2010
Hi

What's the best way to check if a certain spreadsheet function is used in a
cell?
For instance, we want to check if cell A1 uses SUM function considering that
A1 may contain:
1. A1 ="Sum"
2. A1 =SUM(B1:B2)
3. A1 =If(A1="Sum","True",SUM(B1:B2))
These is not a complete list of possibilities. I just wanted to show that
search a formula string for certain words is not the best solution.
Any ideas?

Kind regards
IgorM

 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      25th Feb 2010
Sub dk()
MsgBox Range("B2").Formula
End Sub

Will give you the formula used in B2.


"IgorM" <(E-Mail Removed)> wrote in message
news:BADDC292-FA60-4C7B-AB8E-(E-Mail Removed)...
> Hi
>
> What's the best way to check if a certain spreadsheet function is used in
> a cell?
> For instance, we want to check if cell A1 uses SUM function considering
> that A1 may contain:
> 1. A1 ="Sum"
> 2. A1 =SUM(B1:B2)
> 3. A1 =If(A1="Sum","True",SUM(B1:B2))
> These is not a complete list of possibilities. I just wanted to show that
> search a formula string for certain words is not the best solution.
> Any ideas?
>
> Kind regards
> IgorM



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      25th Feb 2010
You'll have to do your own parsing and if you have any User Defined Functions,
it can be difficult (for me, impossible) to be accurate.

Option Explicit
Function myFunc(str as string)
myfunc = application.evaluate(str)
end function

And this in a cell:
=myeval("sum(a1:a3)")
or:
=myeval("s"&CHAR(117)&CHAR(54*2+1)&"(a1:a3)")


IgorM wrote:
>
> Hi
>
> What's the best way to check if a certain spreadsheet function is used in a
> cell?
> For instance, we want to check if cell A1 uses SUM function considering that
> A1 may contain:
> 1. A1 ="Sum"
> 2. A1 =SUM(B1:B2)
> 3. A1 =If(A1="Sum","True",SUM(B1:B2))
> These is not a complete list of possibilities. I just wanted to show that
> search a formula string for certain words is not the best solution.
> Any ideas?
>
> Kind regards
> IgorM


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
On Error check for Function within Function stickandrock Microsoft Access VBA Modules 1 13th Nov 2009 04:23 PM
Check Function cokparae Microsoft Access Getting Started 7 28th Mar 2007 11:03 PM
Check my IF function KH_GS Microsoft Excel Worksheet Functions 6 6th Apr 2006 09:28 AM
check box function? =?Utf-8?B?c2NvdHQ=?= Microsoft Excel Worksheet Functions 1 29th Dec 2005 07:58 PM
Function to check for whole numbers =?Utf-8?B?RGFz?= Microsoft Excel Worksheet Functions 2 14th Dec 2003 08:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 AM.