Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2011, 06:54 AM
g48dd g48dd is offline Counting Colors Windows XP Counting Colors Office 2003
Novice
Counting Colors
 
Join Date: Jan 2011
Location: Iraq
Posts: 12
g48dd is on a distinguished road
Default Counting Colors

Using Excel 2003: This function will extract the index number of a cell that has color:
Code:
Function getcolor(cell)
getcolor = cell.Interior.ColorIndex
End Function
. It returns a number eg. A1 is yellow. In B1 I insert this function. and point the function to A1. It returns the number 6, becuse 6 is the index number for yellow. You can then sort that column and all of your rows will be sorted by color. However this does not work if the background color is the result of CONDITIONAL FORMATTING. I was wondering if there is someone who would know how to sort by color if the colors are the result of conditional formatting?



Thank you
Ken
Reply With Quote
  #2  
Old 03-13-2011, 07:47 PM
macropod's Avatar
macropod macropod is offline Counting Colors Windows 7 32bit Counting Colors Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,953
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Ken,

Since you know the conditions that trigger the conditional formatting, simply test for those same conditions in your code.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-13-2011, 09:28 PM
g48dd g48dd is offline Counting Colors Windows XP Counting Colors Office 2003
Novice
Counting Colors
 
Join Date: Jan 2011
Location: Iraq
Posts: 12
g48dd is on a distinguished road
Default

I understand what you are saying. I was sort of focused on returning the number I needed, look at the conditions that produce the result I need. This is not easy lol.

Ken
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic counting in a looping powerpoint RCU PowerPoint 0 09-22-2010 12:28 PM
counting occurences of a value in a range but not including 0's nor blanks virsojour Excel 0 07-05-2010 01:34 AM
Counting Colors listing and counting words gencoglux Word 2 05-07-2010 05:10 PM
Counting Colors Counting Weeks leroytrolley Excel 1 08-18-2008 11:12 AM
Counting Legal Words bulletrick Word 0 12-30-2005 03:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft