Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default How do I install a UDF?

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I install a UDF?

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

=========
Remember that you have to allow macros to run for the UDF to work.

GeorgeA wrote:

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default How do I install a UDF?

Installing a User-Defined Function (UDF) means pasting the code into a
general VBA module. Then you can use the UDF like any other function in
regular Excel. This
link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Jon explains step-by-step how to get into the Visual Basic Editor, add a VBA
module, add the code, etc.

Hope this helps,

Hutch

"GeorgeA" wrote:

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default How do I install a UDF?

Thanks! It works now.


"Tom Hutchins" wrote:

Installing a User-Defined Function (UDF) means pasting the code into a
general VBA module. Then you can use the UDF like any other function in
regular Excel. This
link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Jon explains step-by-step how to get into the Visual Basic Editor, add a VBA
module, add the code, etc.

Hope this helps,

Hutch

"GeorgeA" wrote:

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default How do I install a UDF?

Hi Tom,
I installed the UDF and it works, but only when the text is manually
formatted to Red. If I apply conditional formatting for Duplicates to format
the text into Red font, the UDF does not recognize it and returns FALSE
rather than TRUE.

Any chance you could help me out on this?

Thanks,
George

"Tom Hutchins" wrote:

Installing a User-Defined Function (UDF) means pasting the code into a
general VBA module. Then you can use the UDF like any other function in
regular Excel. This
link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Jon explains step-by-step how to get into the Visual Basic Editor, add a VBA
module, add the code, etc.

Hope this helps,

Hutch

"GeorgeA" wrote:

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I install a UDF?

I would use another cell that mimics the formatting conditions and then check
that.

But if you really, really want (it ain't for the faint of heart!), take a look
at how Chip Pearson does it:
http://cpearson.com/excel/CFColors.htm

GeorgeA wrote:

Hi Tom,
I installed the UDF and it works, but only when the text is manually
formatted to Red. If I apply conditional formatting for Duplicates to format
the text into Red font, the UDF does not recognize it and returns FALSE
rather than TRUE.

Any chance you could help me out on this?

Thanks,
George

"Tom Hutchins" wrote:

Installing a User-Defined Function (UDF) means pasting the code into a
general VBA module. Then you can use the UDF like any other function in
regular Excel. This
link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Jon explains step-by-step how to get into the Visual Basic Editor, add a VBA
module, add the code, etc.

Hope this helps,

Hutch

"GeorgeA" wrote:

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default How do I install a UDF?

There is no good way to detect the application of conditional formatting. The
easiest way by far is to use the same logic the conditional formatting is
using to figure out if the cell should be receiving formatting from the
conditional formatting. For example, if your conditional formatting colored
the text red if cells in column A have a value under 50, you can test that
and ColoredRows with an IF(OR formula like this:

=IF(OR(ColoredRow(ROW(A1),3),A1<50),TRUE,FALSE)

and copy down. I read that Excel 2010 may have new features that will allow
us to test formatting applied via conditional formatting.

Hope this helps,

Hutch

"GeorgeA" wrote:

Hi Tom,
I installed the UDF and it works, but only when the text is manually
formatted to Red. If I apply conditional formatting for Duplicates to format
the text into Red font, the UDF does not recognize it and returns FALSE
rather than TRUE.

Any chance you could help me out on this?

Thanks,
George

"Tom Hutchins" wrote:

Installing a User-Defined Function (UDF) means pasting the code into a
general VBA module. Then you can use the UDF like any other function in
regular Excel. This
link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Jon explains step-by-step how to get into the Visual Basic Editor, add a VBA
module, add the code, etc.

Hope this helps,

Hutch

"GeorgeA" wrote:

Hello,
I found this great post from Stefi but I don't know what it means to install
a UDF and can't find any reference in the Excel 2007 HELP files. Can someone
help me.

Install this UDF (post if you need assistance in installing), enter
=ColoredRow(ROW(),3) in all rows in an unused column! Autofilter the TRUE
values in this column, and copy them into a separate sheet!

Function ColoredRow(rownum, colorcode)
ColoredRow = False
For Each cella In Range(rownum & ":" & rownum)
If cella.Font.ColorIndex = colorcode Then
ColoredRow = True
Exit Function
End If
Next cella
End Function

Regards,
Stefi

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
try to install a security update, prompted to install PRO11.msi najib Setting up and Configuration of Excel 0 June 4th 08 05:43 PM
What program do I install to install office 2003 with no prior pro lwd Excel Discussion (Misc queries) 1 January 8th 06 09:37 PM
Can't install add-in BillD Excel Worksheet Functions 3 January 7th 06 03:08 AM
Why does PHStats *NOT* install when I install Analytical ToolPak? webeditor-coutre Setting up and Configuration of Excel 1 July 5th 05 06:58 AM
XP Install question Doug Excel Discussion (Misc queries) 1 April 26th 05 04:17 PM


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