Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I distinguish if a cell has formula entry (ex: =sum(A1:A25) ) vs. a
simple "numeric entry (ex: 123)? -would the most efficient way be to check if Right(AnyString, 1) = "=" thanks in advance, -mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
Dim F As String Dim S As String F = ActiveCell.Formula S = Application.ConvertFormula(F, xlA1, xlR1C1) If F = S Then Debug.Print "No cell references" Else Debug.Print "cell references" End If "mark kubicki" wrote in message ... How can I distinguish if a cell has formula entry (ex: =sum(A1:A25) ) vs. a simple "numeric entry (ex: 123)? -would the most efficient way be to check if Right(AnyString, 1) = "=" thanks in advance, -mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
what about formulas which use named ranges.
like =MyRange +1 ? Chip Pearson wrote: Try Dim F As String Dim S As String F = ActiveCell.Formula S = Application.ConvertFormula(F, xlA1, xlR1C1) If F = S Then Debug.Print "No cell references" Else Debug.Print "cell references" End If "mark kubicki" wrote in message ... How can I distinguish if a cell has formula entry (ex: =sum(A1:A25) ) vs. a simple "numeric entry (ex: 123)? -would the most efficient way be to check if Right(AnyString, 1) = "=" thanks in advance, -mark |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
what about formulas which use named ranges.
Maybe one could include something like this: Dim nPrecedents As Long On Error Resume Next 'In case there are none nPrecedents = ActiveCell.Precedents.Count If n 0 Then ' There are cell references... End If -- HTH. :) Dana DeLouis Windows XP, Office 2003 "witek" wrote in message ... what about formulas which use named ranges. like =MyRange +1 ? Chip Pearson wrote: Try Dim F As String Dim S As String F = ActiveCell.Formula S = Application.ConvertFormula(F, xlA1, xlR1C1) If F = S Then Debug.Print "No cell references" Else Debug.Print "cell references" End If "mark kubicki" wrote in message ... How can I distinguish if a cell has formula entry (ex: =sum(A1:A25) ) vs. a simple "numeric entry (ex: 123)? -would the most efficient way be to check if Right(AnyString, 1) = "=" thanks in advance, -mark |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Dana DeLouis" wrote in message
... what about formulas which use named ranges. Maybe one could include something like this: Dim nPrecedents As Long On Error Resume Next 'In case there are none nPrecedents = ActiveCell.Precedents.Count If n 0 Then ' There are cell references... End If -- HTH. :) Dana DeLouis Maybe I missed something, but why not:: if ActiveCell.HasFormula then 'has formula with or without cell references (example for 'without reference': =10+5) else 'no formula end if Joerg |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dana,
precedents EXCLUDE references to cells other than activesheet. [sheet1!a1].formula = "=sheet2!a1" msgbox [sheet1!a1].precedents.count '<No CellsFound Testing .Formula < .Value appears similar to .HasFormula surprisingly it is 3x faster. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Dana DeLouis wrote in what about formulas which use named ranges. Maybe one could include something like this: Dim nPrecedents As Long On Error Resume Next 'In case there are none nPrecedents = ActiveCell.Precedents.Count If n 0 Then ' There are cell references... End If |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Very good point.
"witek" wrote in message ... what about formulas which use named ranges. like =MyRange +1 ? Chip Pearson wrote: Try Dim F As String Dim S As String F = ActiveCell.Formula S = Application.ConvertFormula(F, xlA1, xlR1C1) If F = S Then Debug.Print "No cell references" Else Debug.Print "cell references" End If "mark kubicki" wrote in message ... How can I distinguish if a cell has formula entry (ex: =sum(A1:A25) ) vs. a simple "numeric entry (ex: 123)? -would the most efficient way be to check if Right(AnyString, 1) = "=" thanks in advance, -mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to confirm entry in Col "C" is valid for data in Col "A" | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"." on numeric keypad displays "," | Excel Discussion (Misc queries) | |||
Excel: Changing "numeric $" to "text $" in a different cell. | Excel Worksheet Functions | |||
If A3=alpha numeric,"X", if A3=text,"Y", Blank | Excel Worksheet Functions |