I have been trying to run some VBA code using the colorindex value of conditionally formatted cells to return row numbers and other information about the location of that cell. For the past hour I have been trying to figure out why my code will not work, only to discover that conditional formatting does not change the .interior.colorindex value of the cell. All cells which change interior color as a result of conditional formatting show a color index value of -4142. Has anyone else had this problem?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Trapping colorindex value of CFormatted cell (2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Trapping colorindex value of CFormatted cell (2000)
- This topic has 3 replies, 3 voices, and was last updated 23 years, 9 months ago.
AuthorTopicWSMichaelRead
AskWoody LoungerAugust 20, 2001 at 2:42 am #359274Viewing 0 reply threadsAuthorReplies-
WSBrooke
AskWoody Lounger -
WSMichaelRead
AskWoody LoungerAugust 20, 2001 at 11:48 am #538109I think I see some of what you’re saying Brooke. I am still puzzled as to why the following will not work:
Public Sub VarList() Dim ST As Long 'ThisWorkbook.Sheets("Variance List").Visible = True 'ThisWorkbook.Sheets("Variance List").Activate For Each cell In ThisWorkbook.Sheets("Deposit Rec").Range("e4:e38") With cell If .Interior.ColorIndex xlColorIndexNone Then ST = cell.Value PrintVar (ST) End If End With Next End Sub
If conditional formatting actually changes the interior color of the cell, a person would think that Selection.Interior.ColorIndex would return the proper value. I am trying to return the colorindex of the cell after it has been changed via conditional formatting.
If I put .ConditionalFormats(1).Interior.ColorIndex, this would return the colorindex of the format should the condition apply. Y? N?
-
WSAndrew Cronnolly
AskWoody LoungerAugust 20, 2001 at 12:33 pm #538117Mike,
I think you best approach would be to test for the condition that gives rise to the color being applied, for example if cells < 100 are colored red, and you want to do something with th ered cells then check for values less than 100 etc. The actual colorindex of a cell remains the same regardless of conditional formatting.
Using .ConditionalFormats(1).Interior.ColorIndex will return the actual color index that applies to condition 1, whether ithe condition is met or not.
Andrew
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
You can’t handle me
by
Susan Bradley
1 hour, 12 minutes ago -
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
2 hours, 10 minutes ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
3 hours, 18 minutes ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
3 hours, 29 minutes ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
3 hours, 41 minutes ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
3 hours, 47 minutes ago -
Lumma malware takedown
by
EyesOnWindows
11 hours, 1 minute ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
12 hours, 34 minutes ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
12 hours, 29 minutes ago -
Meet Gemini in Chrome
by
Alex5723
16 hours, 34 minutes ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
16 hours, 42 minutes ago -
Trump signs Take It Down Act
by
Alex5723
1 day ago -
Do you have a maintenance window?
by
Susan Bradley
11 hours, 51 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
2 hours, 53 minutes ago -
Cox Communications and Charter Communications to merge
by
not so anon
1 day, 4 hours ago -
Help with WD usb driver on Windows 11
by
Tex265
1 day, 9 hours ago -
hibernate activation
by
e_belmont
1 day, 12 hours ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
1 day, 16 hours ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 day, 19 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 day, 19 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
15 hours, 54 minutes ago -
Out of band for Windows 10
by
Susan Bradley
2 days ago -
Giving UniGetUi a test run.
by
RetiredGeek
2 days, 7 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
2 days, 15 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
10 hours, 54 minutes ago -
Auto Time Zone Adjustment
by
wadeer
2 days, 19 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
2 days, 17 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
16 hours, 45 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
1 day, 10 hours ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
10 hours, 23 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.