Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Can I use a User-Defined Funcion in a Conditional Format formula?

Doesn't see to work for me.

-Sal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Can I use a User-Defined Funcion in a Conditional Format formula?

yes you can. What is your function and how are you trying to call
it.

This works for me:

Public Function foo(bar As Range)
foo = 2 * bar.Value
End Function


CF1: Formula is =foo(A1) <=10 == patterns/red

turns the background cell color red if the cell value <=5


In article ,
(Sally) wrote:

Doesn't see to work for me.

-Sal

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Can I use a User-Defined Funcion in a Conditional Format formula?

it does work

"Sally" wrote in message
om...
Doesn't see to work for me.

-Sal



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Can I use a User-Defined Funcion in a Conditional Format formula?

"Barmaley" wrote in message ...
it does work

"Sally" wrote in message
om...
Doesn't see to work for me.

-Sal


ok, I jumped the gun, but there seems to be something weird here.

I have one user defined function, all it does is return the value sent
Function rowTestInteger(r As Integer) As Integer
rowTestInteger = r
End Function

I have 6 cells a1::b3
all with the formula =rowTestInteger(ROW())

results
1 1
2 2
3 3

So far fine

In column a, the conditional format is the same for all three
=rowTestInteger(ROW())=2
=rowTestInteger(ROW())=2
=rowTestInteger(ROW())=2

in Columns b, I change it a bit to
=rowTestInteger(b1)=2
=rowTestInteger(b2)=2
=rowTestInteger(b3)=2

I set the formats to background of red

a2 and b2 BOTH should be red, but only b2 is.
a2=2=ROW(), so it should be red too, but for some reason it is not!!!

-Sal
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
Copy Conditional Format by formula containing cell defined name Carr Excel Discussion (Misc queries) 2 March 18th 09 02:02 AM
user defined functions format df_newtovba Excel Discussion (Misc queries) 3 September 22nd 08 05:17 PM
Custom Format for User Defined Function [email protected] Excel Discussion (Misc queries) 5 August 7th 06 11:27 PM
Format a cell with numbers and user defined text Rod R. Excel Discussion (Misc queries) 0 March 30th 05 04:31 PM
User-defined function with a naming format of =ABC.XYZ. Vipul S. Parekh Excel Programming 1 July 31st 03 02:44 AM


All times are GMT +1. The time now is 11:13 AM.

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"