how can I obtain the values of the conditional formatting of an ActiveCell using VBA??
Preferrably placed in a MsgBox.
how can I obtain the values of the conditional formatting of an ActiveCell using VBA??
Preferrably placed in a MsgBox.
New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.
You want to know what type of conditional formatting is used on the activecell?
I don't know of a way right off to put it into a message box, but why not just run this that brings up the Conditional formats dialog, it will display whatever format (if any) that cell has:
I have a strong feeling that I am misinterpreting your question though..Option Explicit Sub GetConds() Application.Dialogs(xlDialogConditionalFormatting).Show End Sub
Justin Labenne
Could try something like this, but as Justin says, it kind of depends what you want to see...
Sub test() Dim cl As Range Set cl = ActiveCell Dim l As Long For l = 1 To cl.FormatConditions.Count MsgBox cl.Address & " is between " & cl.FormatConditions.Item(l).Formula1 & _ " and " & cl.FormatConditions.Item(1).Formula2 & vbNewLine & _ " and applies a color index of " & cl.FormatConditions.Item(1).Interior.ColorIndex Next l End Sub
Ken Puls, CMA - Microsoft MVP (Excel)
I hate it when my computer does what I tell it to, and not what I want it to.
Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar
This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!
Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!
I can try to work with what both you guys gave me. Justin's won't work on my worksheet because it is protected and I don't have the password.
How do I get WHICH .Item(#) it is?? I don't even know if it uses the "cell between" or the "formula is" conditions...
UNLESS of course you guys know how to obtain the worksheet password
New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.
So... should we ask why you're trying to figure out what the conditional formatting is on a protected sheet for which you don't have the password?
Honestly, we could remove the worksheet password, but I'd rather not do that.
What you could do is step through the macro one line at a time. Make sure you have the Locals window open. Drill down through cl (once it has a plus sign beside it) and drill into the FormatConditions property. You should be able to expose everything you need.
HTH,
Ken Puls, CMA - Microsoft MVP (Excel)
I hate it when my computer does what I tell it to, and not what I want it to.
Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar
This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!
Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!
Yeah, you can ask. You may have seen this in HTML format, OR you may have been forwarded this Workbook. It displays images of movies, except the people in the pictures are invisible. And you have to guess what movie each picture is from. It's pretty cool, but I'm getting frustrated at some of these and I want to know the answers (so I thought I could sneak around the program to figure it out).Originally Posted by kpuls
Check it out, the file was too large. So here is the link:
http://uk.download.yahoo.com/ne/fu/attachments/namethatfilm1c.xls
New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.
and be sure to click on the top link...I can't seem to get rid of that last "xls" link ???
New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.
These kinds of tests usually have a hidden formula (Like in a cell behind the picture) to read what you put in for the answer. The conditional formatting will adjust based on the formula result.
Justin Labenne
Getting the conditional formatting (which you can do in the VBE) won't help you.
You will need to crack the security .. or know your films
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
FiguresOriginally Posted by TonyJollans
Eh, I'll figure it out. Thanks anyway.
New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.