#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default custom function

i do a lot of comparing cells. my go-to formula is "=c1=c2". Of course I
get a true if they're equal and false otherwise. If I have a lot of cells I
sometimes add conditional formatting that colors the cells false red.

Now my question...maybe I could create a custom function in my personal.xls
workbook that does the compare and the conditional formatting in a single
step. Is something like this worth pursuing?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default custom function


Put this UDF in a REGULAR module. In the cell =cif(a1,b1)

Function cif(x, y)
If x = y Then
cif = "Yes"
End If
End Function

Put this macro in the SHEET module of the sheet desired.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = "Yes" Then Target.Interior.ColorIndex = 35
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Steve" wrote in message
...
i do a lot of comparing cells. my go-to formula is "=c1=c2". Of course I
get a true if they're equal and false otherwise. If I have a lot of cells
I
sometimes add conditional formatting that colors the cells false red.

Now my question...maybe I could create a custom function in my
personal.xls
workbook that does the compare and the conditional formatting in a single
step. Is something like this worth pursuing?


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
Ned Help W/ Custom Function japorms Excel Worksheet Functions 3 August 14th 06 09:58 PM
Custom or VBA Function for Avg, Std, Min, Max ExcelMonkey Excel Discussion (Misc queries) 1 July 17th 06 01:26 PM
Custom function Christina L. Excel Worksheet Functions 1 May 10th 06 06:38 PM
Need Help with custom function! AndyB Excel Worksheet Functions 5 July 18th 05 03:56 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


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