LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Marking my sub into a function i can use in excel

Make sure you put this in a standard Module (not a sheet o
ThisWorksheet).

Code
-------------------
Public Function countnonwhite(rInput As Range) as Single

Dim nonwhite As Single
nonwhite = 0
countnonwhite = 0

For Each c In ActiveSheet.Range(rInput)
If c.Interior.ColorIndex < -4142 Then nonwhite = nonwhite + 1
Next

countnonwhite = nonwhite

End Su
-------------------

Use it by entering =countnonwhite(A1:C100)



--
Message posted from http://www.ExcelForum.com

 
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
Marking cells Mark Excel Discussion (Misc queries) 3 June 15th 09 03:55 PM
Marking page end lucy Excel Worksheet Functions 2 October 7th 08 12:04 AM
Excel 2007 Conditional Format: Marking Absences RJBohn3 Excel Discussion (Misc queries) 1 May 19th 07 06:03 PM
coloured marking Roland Burger New Users to Excel 5 April 14th 05 01:16 PM
Water marking Excel J. Joshi Excel Discussion (Misc queries) 1 February 10th 05 08:37 PM


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