Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default CF to distinguish Formulas from Inputs

Hi All,

I have been trying (unsuccessfully) to have Excel format cells with
values that are inputs (i.e. directly entered and NOT the result of
formulas) so that I can quickly distinguish actual values from the
formulas used to project the trends of these values into the future. But
Excel seems to see both types of cells as values regardless of whether
the value was directly entered or derived from a formula.

I'd be happy for any solution that will work, whether CF, user-defined
number format, or VBA. I've tried all 3 and haven't cracked it but my
knowledge of VBA is pretty limited.

Many thanks!
Brian Ballek
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default CF to distinguish Formulas from Inputs

Here's one possible way you could test if the cell is a formula or not.

Sub test()

For Each cell In Range("D6:D7")
If Left(cell.Formula, 1) = "=" _
Then
MsgBox ("Cell " & cell.Address & " is a Formula.")
Else
MsgBox ("Cell " & cell.Address & " is Not a Formula.")
End If
Next cell

End Sub

HTH,
Paul


--

"Brian Ballek" wrote in message
...
Hi All,

I have been trying (unsuccessfully) to have Excel format cells with values
that are inputs (i.e. directly entered and NOT the result of formulas) so
that I can quickly distinguish actual values from the formulas used to
project the trends of these values into the future. But Excel seems to see
both types of cells as values regardless of whether the value was directly
entered or derived from a formula.

I'd be happy for any solution that will work, whether CF, user-defined
number format, or VBA. I've tried all 3 and haven't cracked it but my
knowledge of VBA is pretty limited.

Many thanks!
Brian Ballek



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default CF to distinguish Formulas from Inputs

Brian

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

CFFormula is: =IsFormula(cellref)


Gord Dibben MS Excel MVP

On Mon, 06 Aug 2007 22:57:29 +0200, Brian Ballek
wrote:

Hi All,

I have been trying (unsuccessfully) to have Excel format cells with
values that are inputs (i.e. directly entered and NOT the result of
formulas) so that I can quickly distinguish actual values from the
formulas used to project the trends of these values into the future. But
Excel seems to see both types of cells as values regardless of whether
the value was directly entered or derived from a formula.

I'd be happy for any solution that will work, whether CF, user-defined
number format, or VBA. I've tried all 3 and haven't cracked it but my
knowledge of VBA is pretty limited.

Many thanks!
Brian Ballek


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default CF to distinguish Formulas from Inputs

Here's a non-VBA method

Create this named formula:

Goto InsertNameDefine
Name: IsFormula
Refers to: =GET.CELL(48,INDIRECT("RC",FALSE))
OK

Apply conditional formatting to the cells in question.
Assume this range of cells is A1:A10
Select the range A1:A10
Goto FormatConditional Formatting
Formula Is: =IsFormula
Click the Format button
Select the style(s) desired
OK out

--
Biff
Microsoft Excel MVP


"Brian Ballek" wrote in message
...
Hi All,

I have been trying (unsuccessfully) to have Excel format cells with values
that are inputs (i.e. directly entered and NOT the result of formulas) so
that I can quickly distinguish actual values from the formulas used to
project the trends of these values into the future. But Excel seems to see
both types of cells as values regardless of whether the value was directly
entered or derived from a formula.

I'd be happy for any solution that will work, whether CF, user-defined
number format, or VBA. I've tried all 3 and haven't cracked it but my
knowledge of VBA is pretty limited.

Many thanks!
Brian Ballek



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default CF to distinguish Formulas from Inputs

Yup, that did it - Fantastic! What I actually wanted was to highlight
values that *aren't* from formulas (so all the variables in a sheet are
clearly seen) but for that I just modified the CF to

=IsFormula=False

THANKS!

T. Valko wrote:
Here's a non-VBA method

Create this named formula:

Goto InsertNameDefine
Name: IsFormula
Refers to: =GET.CELL(48,INDIRECT("RC",FALSE))
OK

Apply conditional formatting to the cells in question.
Assume this range of cells is A1:A10
Select the range A1:A10
Goto FormatConditional Formatting
Formula Is: =IsFormula
Click the Format button
Select the style(s) desired
OK out



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default CF to distinguish Formulas from Inputs

Ok, that'll work but it's using "reverse" logic. How about this using
"straight" logic...

InsertNameDefine
Name: IsConstant
Refers to: =NOT(GET.CELL(48,INDIRECT("RC",FALSE)))

Then

Again, assuming the range of interest is A1:A10
Conditional Formatting
Formula Is: =AND(A1<"",IsConstant)

The addition of AND(A1<"" keeps empty cells from being highlighted.

--
Biff
Microsoft Excel MVP


"Brian Ballek" wrote in message
...
Yup, that did it - Fantastic! What I actually wanted was to highlight
values that *aren't* from formulas (so all the variables in a sheet are
clearly seen) but for that I just modified the CF to

=IsFormula=False

THANKS!

T. Valko wrote:
Here's a non-VBA method

Create this named formula:

Goto InsertNameDefine
Name: IsFormula
Refers to: =GET.CELL(48,INDIRECT("RC",FALSE))
OK

Apply conditional formatting to the cells in question.
Assume this range of cells is A1:A10
Select the range A1:A10
Goto FormatConditional Formatting
Formula Is: =IsFormula
Click the Format button
Select the style(s) desired
OK out



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default CF to distinguish Formulas from Inputs

"Brian Ballek" wrote:
..What I actually wanted was to highlight values that *aren't* from
formulas (so all the variables in a sheet are clearly seen)


Laterally thinking ..

Press F5 Special Check "Constants" OK
selects all non-formula cells in the sheet

Press F5 Special Check "Formulas" OK
selects all formula cells in the sheet

With the above selections done in a flash, you could then easily Format
Cells to taste
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default CF to distinguish Formulas from Inputs

I believe that it might not be a bad idea to always include a warning
whenever suggesting the use of these 4.0 macros.

Caveat:
This can safely be used in versions of XL, from XL02 onward.

Earlier versions *WILL* CRASH*, causing the loss of all unsaved work, when
attempting to copy these formulas to other WBs.
Can be used safely in earlier versions as long as copying is restricted to
sheets within the existing WB.

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------



"T. Valko" wrote in message
...
Ok, that'll work but it's using "reverse" logic. How about this using
"straight" logic...

InsertNameDefine
Name: IsConstant
Refers to: =NOT(GET.CELL(48,INDIRECT("RC",FALSE)))

Then

Again, assuming the range of interest is A1:A10
Conditional Formatting
Formula Is: =AND(A1<"",IsConstant)

The addition of AND(A1<"" keeps empty cells from being highlighted.

--
Biff
Microsoft Excel MVP


"Brian Ballek" wrote in message
...
Yup, that did it - Fantastic! What I actually wanted was to highlight
values that *aren't* from formulas (so all the variables in a sheet are
clearly seen) but for that I just modified the CF to

=IsFormula=False

THANKS!

T. Valko wrote:
Here's a non-VBA method

Create this named formula:

Goto InsertNameDefine
Name: IsFormula
Refers to: =GET.CELL(48,INDIRECT("RC",FALSE))
OK

Apply conditional formatting to the cells in question.
Assume this range of cells is A1:A10
Select the range A1:A10
Goto FormatConditional Formatting
Formula Is: =IsFormula
Click the Format button
Select the style(s) desired
OK out





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
Prevent Hard Inputs Frederik12 Excel Discussion (Misc queries) 3 August 15th 06 05:14 PM
how to distinguish between text cells? phaidon New Users to Excel 2 April 12th 06 09:42 AM
All number inputs are divided by 100 ? davor Setting up and Configuration of Excel 2 March 24th 06 01:05 AM
Multiple inputs one output Chris W via OfficeKB.com Excel Discussion (Misc queries) 1 August 25th 05 07:00 PM
Copying field inputs BobR Excel Discussion (Misc queries) 1 February 23rd 05 07:49 PM


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