ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Formating Bug when using HasFormula UDF (https://www.excelbanter.com/excel-programming/371375-conditional-formating-bug-when-using-hasformula-udf.html)

Martin Brader

Conditional Formating Bug when using HasFormula UDF
 
Something strange is happening in Excel 2003 SP2.
I am using this udf to Conditional Format a cell on Sheet2
Function cf_NotFormula(cell)
'based on http://www.mvps.org/dmcritchie/excel...htm#HasFormula
cf_NotFormula = Not cell.HasFormula And Not IsEmpty(cell) _
And Not cell.Row = 1
End Function

When I go to Sheet1 cell A1 and type in "=" and then point to cell A2 on
Sheet2 (to hopefully create =Sheet2!A2 in cell A1 on Sheet1) and then press
ENTER something very strange happens. Sheet2 remains in view and a spurious
entry materialises in Cell A1 on Sheet2 (usually). I've got a small test
model available if you want try it for yourself.

I have narrowed the problem down to the .HasFormula property.




Martin Brader[_2_]

Conditional Formating Bug when using HasFormula UDF
 
In case anyone needs to get in touch with me about this my email address was
set incorrectly on this post. It should have been

"Martin Brader" wrote in message
...
Something strange is happening in Excel 2003 SP2.
I am using this udf to Conditional Format a cell on Sheet2
Function cf_NotFormula(cell)
'based on
http://www.mvps.org/dmcritchie/excel...htm#HasFormula
cf_NotFormula = Not cell.HasFormula And Not IsEmpty(cell) _
And Not cell.Row = 1
End Function

When I go to Sheet1 cell A1 and type in "=" and then point to cell A2 on
Sheet2 (to hopefully create =Sheet2!A2 in cell A1 on Sheet1) and then
press
ENTER something very strange happens. Sheet2 remains in view and a
spurious
entry materialises in Cell A1 on Sheet2 (usually). I've got a small test
model available if you want try it for yourself.

I have narrowed the problem down to the .HasFormula property.







All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com