Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Cormac
 
Posts: n/a
Default formula to differenciate whether a cell contains a funtion or numb

I wish to change the formating of a cell depending on whether it's containts
are a number which is:
a) from reference to another cell on another sheet worksheet or
b) directly entered by the user and typed over the formula

The application is a time sheet where the "planned/forcast number" is
supplied and and the user updates as they progress by over writing with
actuals numbers. I would like to have the backgound cell colour change
depending on whether the value is forcast or actual.

Any suggestions?

Cormac.
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default formula to differenciate whether a cell contains a funtion or numb

On Tue, 1 Nov 2005 09:01:06 -0800, Cormac
wrote:

I wish to change the formating of a cell depending on whether it's containts
are a number which is:
a) from reference to another cell on another sheet worksheet or
b) directly entered by the user and typed over the formula

The application is a time sheet where the "planned/forcast number" is
supplied and and the user updates as they progress by over writing with
actuals numbers. I would like to have the backgound cell colour change
depending on whether the value is forcast or actual.

Any suggestions?

Cormac.


You can do this with a combination of a VBA routine and conditional formatting.

First the VBA routine which is a UDF to determine if the cell contains a
formula:

<alt<F11 opens the VB Editor.
Ensure your project is highlighted in the Project Explorer window, then
Insert/Module and paste the code below into the window that opens.

==================
Function IsFormula(cell)
IsFormula = cell.HasFormula
End Function
===================

Now select the cell(s) you wish to conditionally format.

Format/Conditional Formatting

Formula Is: =IsFormula(cell) (or =IsFormula(cell) = TRUE)

or =IsFormula(cell) = FALSE

where 'cell' is the cell reference of the active cell amongst the selected
cells. Be sure to enter this address without $'s.

Depending on how you want to do the formatting.







--ron
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default formula to differenciate whether a cell contains a funtion or numb

Cormac

One method........

Use a UDF to see if cell contains formula or not then place conditional
formatting on the cell.

Function IsFormula(Cell)
Application.Volatile
IsFormula = Cell.HasFormula
End Function

usage for CFFormula is: =ISFORMULA(cellref)


Gord Dibben Excel MVP

On Tue, 1 Nov 2005 09:01:06 -0800, Cormac
wrote:

I wish to change the formating of a cell depending on whether it's containts
are a number which is:
a) from reference to another cell on another sheet worksheet or
b) directly entered by the user and typed over the formula

The application is a time sheet where the "planned/forcast number" is
supplied and and the user updates as they progress by over writing with
actuals numbers. I would like to have the backgound cell colour change
depending on whether the value is forcast or actual.

Any suggestions?

Cormac.


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
Using contents of a cell in a formula Mike Excel Discussion (Misc queries) 4 June 9th 05 03:10 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Can a Formula in Cell X modify Cell Y? alMandragor Excel Discussion (Misc queries) 7 February 10th 05 09:51 PM
looking for a formula Amanda Excel Worksheet Functions 5 January 5th 05 07:37 AM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM


All times are GMT +1. The time now is 05:08 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"