Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 383
Default Format Cell formula vs number

Hi, is there a formula for cond. format, if cell is formula / not a formula,
then no formatting / background color. this would occur if typing a number
in place of formula. thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Format Cell formula vs number

Add this UDF to a module in your workbook.

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

In CFFormula is: =IsFormula(cellref)


Gord Dibben MS Excel MVP


On Mon, 30 Apr 2007 11:32:01 -0700, nastech
wrote:

Hi, is there a formula for cond. format, if cell is formula / not a formula,
then no formatting / background color. this would occur if typing a number
in place of formula. thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 383
Default Format Cell formula vs number

hi, thanks; seems I have hardest time with code.
with this example pasted on sheet 2 tab, (right-click, view code, paste..)
did hit save, not sure if necessary; entering a cond. format for background
to go red (for: =isformula(K12)), nothing happens for any present of:
formula, number, empty, text

imagine something simple i am missing

"Gord Dibben" wrote:

Add this UDF to a module in your workbook.

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

In CFFormula is: =IsFormula(cellref)


Gord Dibben MS Excel MVP


On Mon, 30 Apr 2007 11:32:01 -0700, nastech
wrote:

Hi, is there a formula for cond. format, if cell is formula / not a formula,
then no formatting / background color. this would occur if typing a number
in place of formula. thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Format Cell formula vs number

The UDF is to be copied and pasted to a general module in your workbook.

It is a Function, not an event.

Alt + F11 to open VBE then CTRL + r to open Project Explorer.

Right-click on your workbook/project and InsertModule.


Gord

On Mon, 30 Apr 2007 14:04:02 -0700, nastech
wrote:

hi, thanks; seems I have hardest time with code.
with this example pasted on sheet 2 tab, (right-click, view code, paste..)
did hit save, not sure if necessary; entering a cond. format for background
to go red (for: =isformula(K12)), nothing happens for any present of:
formula, number, empty, text

imagine something simple i am missing

"Gord Dibben" wrote:

Add this UDF to a module in your workbook.

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

In CFFormula is: =IsFormula(cellref)


Gord Dibben MS Excel MVP


On Mon, 30 Apr 2007 11:32:01 -0700, nastech
wrote:

Hi, is there a formula for cond. format, if cell is formula / not a formula,
then no formatting / background color. this would occur if typing a number
in place of formula. thanks




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 383
Default Format Cell formula vs number

thank you much for help.

"Gord Dibben" wrote:

The UDF is to be copied and pasted to a general module in your workbook.

It is a Function, not an event.

Alt + F11 to open VBE then CTRL + r to open Project Explorer.

Right-click on your workbook/project and InsertModule.


Gord

On Mon, 30 Apr 2007 14:04:02 -0700, nastech
wrote:

hi, thanks; seems I have hardest time with code.
with this example pasted on sheet 2 tab, (right-click, view code, paste..)
did hit save, not sure if necessary; entering a cond. format for background
to go red (for: =isformula(K12)), nothing happens for any present of:
formula, number, empty, text

imagine something simple i am missing

"Gord Dibben" wrote:

Add this UDF to a module in your workbook.

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

In CFFormula is: =IsFormula(cellref)


Gord Dibben MS Excel MVP


On Mon, 30 Apr 2007 11:32:01 -0700, nastech
wrote:

Hi, is there a formula for cond. format, if cell is formula / not a formula,
then no formatting / background color. this would occur if typing a number
in place of formula. thanks






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 383
Default Format Cell formula vs number


on first sheet, am using code:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Target.Row < 56 Then Exit Sub
If Me.Cells(.Row, "A").Value = "." Then Exit Sub
If Not Intersect(Me.Range("BF:BG"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Me.Cells(.Row, "BD")
.NumberFormat = "dd"
.Value = Now
End With
Application.EnableEvents = True
End If
End With
End Sub


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Format Cell formula vs number

Enter this one-line UDF:

Function isformula(r As Range) As Boolean
isformula = r.HasFormula
End Function

and then for any cell, say A1, pull-down:
Format Conditional Formatting Formula is and then
=isformula(a1)
--
Gary''s Student - gsnu200718

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 383
Default Format Cell formula vs number

hi, thanks; seems I have hardest time with code.
with this example pasted on SHEET 2 tab, (right-click, view code, paste..)
did hit save, not sure if necessary; entering a cond. format for background
to go red (for: =isformula(K12)), nothing happens for any present of:
formula, number, empty, text

imagine something simple i am missing; On First Sheet, am using code:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Target.Row < 56 Then Exit Sub
If Me.Cells(.Row, "A").Value = "." Then Exit Sub
If Not Intersect(Me.Range("BF:BG"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Me.Cells(.Row, "BD")
.NumberFormat = "dd"
.Value = Now
End With
Application.EnableEvents = True
End If
End With
End Sub


"Gary''s Student" wrote:

Enter this one-line UDF:

Function isformula(r As Range) As Boolean
isformula = r.HasFormula
End Function

and then for any cell, say A1, pull-down:
Format Conditional Formatting Formula is and then
=isformula(a1)
--
Gary''s Student - gsnu200718

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
Number format in a formula Vicki Excel Worksheet Functions 8 June 29th 06 08:13 PM
Format a cell with a custom number format Armor Excel Worksheet Functions 4 January 29th 06 11:25 PM
Format cell for number example 0.123 DKR Excel Discussion (Misc queries) 1 September 14th 05 02:16 AM
number format problem when using =A1&A2 formula N E Body Excel Discussion (Misc queries) 3 June 14th 05 09:34 PM
How to add the number in cell one by one in Hex format hon123456 Excel Discussion (Misc queries) 1 January 13th 05 12:51 PM


All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"