Adding more than three Conditions to 'Conditional Formatting'

Can i add more than three conditions to the conditional formatting
presets using code?

Regards

[Riz]


-- 
Rizitsu
------------------------------------------------------------------------
Rizitsu's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=15840
View this thread: http://www.excelforum.com/showthread.php?threadid=320382

0
11/25/2004 12:56:12 PM
excel.misc 78881 articles. 5 followers. Follow

9 Replies
1167 Views

Similar Articles

[PageSpeed] 25

Riz, as you have found out, only 3 conditions with conditional formatting.
But yes you can use some code to get more than 3, try this it will change
the cell color in column A when you put in one ,two, three, or four, right
click on the sheet tab and view code, paste it in the window that opens.

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
        With Target
        Select Case LCase(.Value)
            Case Is = "one":  .Interior.ColorIndex = 5
            Case Is = "two": .Interior.ColorIndex = 6
            Case Is = "three": .Interior.ColorIndex = 7
            Case Is = "four": .Interior.ColorIndex = 8
            Case Else
                .Interior.ColorIndex = xlNone
        End Select
    End With
    End Sub


-- 
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Rizitsu" <Rizitsu.1ga2hz@excelforum-nospam.com> wrote in message
news:Rizitsu.1ga2hz@excelforum-nospam.com...
>
> Can i add more than three conditions to the conditional formatting
> presets using code?
>
> Regards
>
> [Riz]
>
>
> -- 
> Rizitsu
> ------------------------------------------------------------------------
> Rizitsu's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=15840
> View this thread: http://www.excelforum.com/showthread.php?threadid=320382
>


0
11/25/2004 1:19:26 PM
Riz,

There is an addin for this at
http://www.xldynamic.com/source/xld.CFPlus.Download.html

-- 

HTH

RP
(remove nothere from the email address if mailing direct)


"Rizitsu" <Rizitsu.1ga2hz@excelforum-nospam.com> wrote in message
news:Rizitsu.1ga2hz@excelforum-nospam.com...
>
> Can i add more than three conditions to the conditional formatting
> presets using code?
>
> Regards
>
> [Riz]
>
>
> -- 
> Rizitsu
> ------------------------------------------------------------------------
> Rizitsu's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=15840
> View this thread: http://www.excelforum.com/showthread.php?threadid=320382
>


0
bob.phillips1 (6510)
11/25/2004 1:50:40 PM
This isn't help but...

Can you hide rows/cells using conditional formatting?

If so, how?

Thanks

mar

--
mark_b241
-----------------------------------------------------------------------
mark_b2410's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1684
View this thread: http://www.excelforum.com/showthread.php?threadid=32038

0
11/25/2004 2:08:01 PM
mark

You cannot hide rows using CF.

You could color the font to white so's it doesn't show up on-screen.

Then you have to make the cells "hidden" so's they wouldn't show in the
Formula Bar.

Then you have to protect the worksheet so's users could not change things.

You would be better off using VBA code to hide the rows based on some
condition.

Gord Dibben Excel MVP

On Thu, 25 Nov 2004 08:08:01 -0600, mark_b2410
<mark_b2410.1ga5qn@excelforum-nospam.com> wrote:

>
>This isn't help but...
>
>Can you hide rows/cells using conditional formatting?
>
>If so, how?
>
>Thanks
>
>mark

0
Gord
11/25/2004 4:46:44 PM
Thank you, Si

--
mark_b241
-----------------------------------------------------------------------
mark_b2410's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1684
View this thread: http://www.excelforum.com/showthread.php?threadid=32038

0
11/25/2004 5:18:30 PM
Errr, how do you make the formula "hidden"?

Cheers

Mar

--
mark_b241
-----------------------------------------------------------------------
mark_b2410's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1684
View this thread: http://www.excelforum.com/showthread.php?threadid=32038

0
11/25/2004 5:29:16 PM
Select the cell(s)

Format>Cells>Protection.  Check "Hidden" and OK your way out.

When worksheet protection is enabled, you will see nothing in the Formula Bar.

Gord



On Thu, 25 Nov 2004 11:29:16 -0600, mark_b2410
<mark_b2410.1gaezz@excelforum-nospam.com> wrote:

>
>Errr, how do you make the formula "hidden"?
>
>Cheers
>
>Mark

0
Gord
11/25/2004 6:32:01 PM
Hi Mark,
Not with Conditional Formatting, but you can use Auto Filter
and the formulas just like Conditional Formatting are
Worksheet Functions that return either True or False.

See Debra Dalgleish's site  contextures.com
  Excel Filters -- Advanced Filter -- Complex Criteria
  http://www.contextures.com/xladvfilter02.html
---
HTH,
David McRitchie, Microsoft MVP - Excel    [site changed  Nov. 2001]
My Excel Pages:  http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:        http://www.mvps.org/dmcritchie/excel/search.htm

"mark_b2410" <mark_b2410.1ga5qn@excelforum-nospam.com> wrote in message news:mark_b2410.1ga5qn@excelforum-nospam.com...
>
> This isn't help but...
>
> Can you hide rows/cells using conditional formatting?
>
> If so, how?
>
> Thanks
>
> mark
>
>
> -- 
> mark_b2410
> ------------------------------------------------------------------------
> mark_b2410's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=16848
> View this thread: http://www.excelforum.com/showthread.php?threadid=320382
>


0
dmcritchie (2586)
11/27/2004 5:51:09 PM
Hi Mark,
Probably should have pointed you to this to start with
  Excel Filters -- Advanced Filter
  http://www.contextures.com/xladvfilter01.html

Filters are fun to work with,  when you copy and paste from
a filtered list all you pick up is what is not filtered out, and
Mail Merge (MS Word) only see the filtered list.
  http://www.mvps.org/dmcritchie/excel/mailmerg.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel    [site changed  Nov. 2001]
My Excel Pages:  http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:        http://www.mvps.org/dmcritchie/excel/search.htm

> "mark_b2410" <mark_b2410.1ga5qn@excelforum-nospam.com> wrote in message
> > This isn't help but...
> > Can you hide rows/cells using conditional formatting?


0
dmcritchie (2586)
11/27/2004 6:03:03 PM
Reply:

Similar Artilces:

Pivot Table Formatting #7
Some of the formatting on my Pivot Tables remain after refreshing, some formatting does not. I have "preserve formatting" checked, "Autoformat Table" unchecked. Excel 2002. Any help would be appreciated - I have had formatting problems with Pivot Tables for years!! You may have to enable selection (From the Pivot toolbar, choose PivotTable>Select, and click on Enable Selection) Before formatting cells, use the selection feature to select the cells. For example, move the pointer to the top of a column in the pivot table (just above the column's heading cell...

Adding Blank Rows after the last Detail of the Report
Hi All, I've used this code from Dwayne: Private Sub Report_Page() Dim intNumLines As Integer Dim intLineNumber As Integer Dim intTopMargin As Integer Dim ctl As Control Dim intLineHeight As Integer intNumLines = 12 intTopMargin = Me.Section(3).Height intLineHeight = Me.Section(0).Height For Each ctl In Me.Section(0).Controls For intLineNumber = 0 To intNumLines - 1 Me.Line (ctl.Left, intTopMargin + _ (intLineNumber * intLineHeight)) - _ Step(ctl.Width, intLineHeight), , B Next Next End Sub My report needs to print blank rows (at least...

Adding hyperlinks with parameters
Hey everybody I have a batch file which needs to be run from an excel sheet with a parameter, like this: c:\1.bat myParameter But when i try to run the Hyperlink, the Excel shows an error message saying it can't open the specified file (probably because the is a space between the file and the parameter) is there any known way to run the link from the excel? On Mar 2, 12:45=A0pm, Pasha <pavel_v...@mailto.mod.gov.il> wrote: > Hey everybody > I have a batch file which needs to be run from an excel sheet with a > parameter, like this: > c:\1.bat myParameter > But when i ...

outlook vcard, ad integration user properties
my boss is trying to get hix fax# in his vcard. he is using his address from the global address list I have modified his profile in active directory users and computers: I go into AD users and computers, double click on his user, go to the telephones tab, and enter his fax #. but when I did this his fax # is still not being pulled up in his outlook vcard. Does anyone know where outlook is trying to get this field from / how i can get this field into his vcard? thx ...

Formatting Cells/Data
Hi, I hope you are doing well. I have a file I downloaded from our AS/400 (OS400 operating system). I open the file as a text file and go thru the wizard for converting the file to excel format. One of the columns/fields is numeric with some neg and pos numbers and some blank cell contents. During the wizard conversion the field is categorized as DOUBLE with no option to change the field. When I finish the wizard I save the file as an Excel workbook. Then I use the autosum option to calculate the total of the field/column; however, it only picks up on the positive #'s. Hence the t...

Condition Format syntax
I have pairs of cells to test. What I want to check is if the value of the 2nd cell is higher than the first, but less than 1.5 times as high. I've tried various syntax combinations using 'Formula is', but just can't seem to hit the right one (Excel 2003). Can anyone help? -- Paul Hyett, Cheltenham (change 'invalid83261' to 'blueyonder' to email me) Hi Paul, Try this one: =IF(B1>A1,IF(B1<A1*1.5,"Yes","No"),"No") Regards, Per "Paul Hyett" <vidcapper@invalid83261.co.uk> skrev i meddelelsen news:XeIMdj...

ADDING A NUMBER
how do i add a number to a range of cells? I need to add 11.27 to a number of different cells each with a different number in them Put 11.27 in an empty cell, format it the same way as the numbers you want to add to, copy it, then select the numbers you want to add to and do edit>paste special and select add. -- Regards, Peo Sjoblom "Helpme" <Helpme@discussions.microsoft.com> wrote in message news:6D51344A-78E6-4377-B292-FC6C16FF6BA2@microsoft.com... > how do i add a number to a range of cells? I need to add 11.27 to a > number > of different cells e...

XML <IF> condition
Following code segment looks good but the <IF> equates to true always and all departments print... What am I doing wrong? <ROW> "Non-Taxable Sales:" </ROW> <SET name="NonTaxableTotal" type="vbCurrency"> 0 </SET> <SET name="TATTOO" type="vbString"> "TATTOO" </SET> <FOR each="ReportDepartment"> <IF> <CONDITION> Report.Department.Name = TATTOO </CONDITION> <THEN> <ROW> Report.Department.Name &qu...

adding new records
I am totally new to CRM, so I hope this is really easy question: This concerns permissions.. I have a "sales" group, and with one of those people i need to be able to let them add new records on behalf of other "sales" people. Is there like a standard permission setting for it? (obviously every "sales" person can add new records if they select them selfs as the owner) thanks, Michal. Hi, By default the person who creates the record will be the owner. After record creation the person could reassign the record (manually) to another user. If all rec...

When adding attachments...
....in Outlook the following errors comes up: "Out of memory or system resources, please close some programs and try again" Quotas are fine. I have deinstalled/reinstalled Office, cleaned 'temp' areas, and many other tidbits. Any other ideas? Thanks. This might help as i had this problem with Outlook 98. Is the file you are trying to copy to attach nested in sub folders? if so try and copy the attachment to a root drive like c:\ Ignore previous email. wrong spellin if the attachment is nested in sub folders(this means you have to open different folders to get to ...

Help in Query with two condition
hello all, I have a table like this: Planner Qty User6 CUT SUB BAM-06 1 CONC Yes No BAM-06 1 CONC No Yes BAM-06 1 TOC Yes No BAM-06 1 TOC No Yes BAM-06 1 TACT Yes No BAM-06 1 TACT No Yes JAXM-06 1 CONC Yes No JAXM-06 1 CONC No Yes JAXM-06 1 TOC Yes No JAXM-06 1 TOC No Yes JAXM-06 1 TACT Yes No JAXM-06 1 TACT No Yes Note: CUT and SUB are check box I want a result as follow: User6 A B C D E F CONC 2 2 1 1 1 1 TACT 2 2 1 1 1 1 TOC 2 2 1 1 1 1 WHERE: A SUM Qty =BAM-06 B SUM Qty =JAXM-06 C SUM Qty =BAM-06 if Cut=YES D SUM Qty =JAXM-06 if Cut=YES E SUM Qty =BAM-06 if SUB=YES F SUM Qty =JAXM-06 i...

Picture Disappears When Added To Contact In Outlook 2003
Can someone help please. When I try to attach a picture to a contact in outlook 2003 immediately I double click the picture to be attached it disappears out of the outlook contact along with the placement holder in the form. Only when I right click the mouse and go remove picture do I get the placement holder back. I have looked at all the help menus but they offer no clues. Thanks TS ...

Formatting
When my transcriptionist sends me a document in Word (we are both using 2003), the formatting gets slightly changed. ie. there is no longer a space between paragraphs where there should be. It usually takes one hit of the enter key or tab to correct the problem. Why is this happening and how can we fix it. In which format is the document saved? -- Stefan Blom Microsoft Word MVP "Cinpt521" <Cinpt521@discussions.microsoft.com> wrote in message news:34FCBAD4-29FE-4F67-8259-60B455B5B0BD@microsoft.com... > When my transcriptionist sends me a document ...

Conditional Formating based on Odd vs. Even
Hi If row in column A contains an even number, shade that row in Colum B-G Yellow, If odd Shade Gray, If blank No Shade. Can this be done i a formula in Conditional Formatting? If so, how? Help appreciated. Nathan Sargean -- Message posted from http://www.ExcelForum.com Sure. Select B:G Condition 1: Formula is =Len($A1)=0 (no format) Condition 2: Formula is =MOD($A1,2)=0 (yellow format) Condition 3: FOrmula is : =MOD($A1,2)=1 (grey format) Bob Umlas Excel MVP "natei6 >" <<natei6.1699y4@excelforum-nospam.com> wrote in message news:natei6.1699y4@excelforum-no...

Custom Number Format #4
hi there, I�ve got a list of equipments that are tagged with the company� inventory number. Each item has its own tag which�s composed by eigh characters and the first is separated by an "-" , like this example *1-0012345*. Unfortunately the list is generated by an old system that can hold onl 12 character tags and doesn�t support any other symbols. Therefore, it puts a couple of ZEROS to replace the " - " symbol, an another couple of ZEROS at the end to sum up 12 characters. In the end the tags look like: *100001234500*. How can I format the tag column to display the o...

Adding ActiveX to dialog with wrapper
When I add an ActiveX object to a dialog using the dialog editor - right click - insert activeX object, the help on the resulting activex selection tool states that a wrapper will not be added by using this method. If you need a wrapper, it suggests using the class view. This is using Visual Studio 2005. I'm having some problems with this on an existing project. To make sure I understand the process, I created a new MFC project, added a dialog, created a class for that dialog and added a Flexgrid object using the right click method in the dialog. I then added a variable for the flexgrid...

Adding alternate columns
I work on a schedule where I record ticket count and ticket sales for each show, listed chronologically. Column A = week ending date Column B = # Tickets sold for April 5 show Column C = Ticket Revenue for April 5 show Column D = # Tickets sold for April 9 show Column E = Ticket Revenue for April 9 show Column F = # Tickets sold for April 12 show Column G = Ticket Revenue for April 12 show Column H = Total # Tickets sold for all shows Column I = Total Ticket Revenue for all shows In the Totals columns, the Total Tickets formula is "+B4+D4+F4", and the Total Revenue f...

Conditional Colors for Charts #2
Hello, I have on a sheet with several graphs and I would like to execute the procedure below automatically. In advance thank you for the assistance Yves Sub ColorColumns() Dim vntValues As Variant Dim intSeries As Integer Dim intPoint As Integer With ActiveChart For intSeries = 1 To .SeriesCollection.Count With .SeriesCollection(intSeries) vntValues = .Values For intPoint = 1 To .Points.Count If vntValues(intPoint) < 60 Then ..Points(intPoint).Interior.Color = vbRed ElseIf vntValues(intPoint) >= 60 And vntValues(intPoint) < 80 Then ..Points(intPoint).Interior.Color = vbYellow E...

Adding fields from a different query
I have a form built based on a main query. How do I add more fields on that form that come from a different query? Anne A couple possibilities... Change your first query to include the extra fields. Use your second query to "feed" a form, then embed that form as a subform on your main form. Good luck! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudoco...

Adding more than three Conditions to 'Conditional Formatting'
Can i add more than three conditions to the conditional formatting presets using code? Regards [Riz] -- Rizitsu ------------------------------------------------------------------------ Rizitsu's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=15840 View this thread: http://www.excelforum.com/showthread.php?threadid=320382 Riz, as you have found out, only 3 conditions with conditional formatting. But yes you can use some code to get more than 3, try this it will change the cell color in column A when you put in one ,two, three, or four, right click on the she...

Number format problem in web method
Hi all, I have a funny problem. I have a function in Windows Application, which builds dataset in run time, adds data into the dataset and returns XML. One of dataset columns has System.Double type. If I try to insert into this column number in format "###0.00", in the output XML I'll recieve for example "123.45". It works fine. But, if I try to run the same code from the webmethod , I recieve error number format (without "."), for example "12345". What I need to check, reinstall, rebuild, ......? Thank's for help AD...

Printing conditional images
All, I am certain there's a simple answer to this but it has been baffling me so I'm throwing it open to the world after searching the archives with little success. In my worksheet, I have inserted images conditional on cells containing certain values. The code is as follows: ~~~~~~~~~~~~ Private Sub Worksheet_Calculate() Me.Shapes("Picture 1").Visible = (Range("C14") = 2) Me.Shapes("Picture 2").Visible = (Range("C23") = 5.76) End Sub ~~~~~~~~~~~~ The images appear without any problem and all is well on-screen. However, I...

Excel word-wrap format
I have encountered this problem with both single and merged cells: With a lot of text in one cell (over 100 words) the word wrap format works for the majority of the text but the last portion of the text does not wrap -- the text continues off to the right and cannot be seen in regular view, print preview, or on the hard copy print out. All text is visible in the edit field. To get all of the text to appear on a printout I must put in hard returns (Alt-Enter) throughout the last portion of the text, experimenting with line brakes to get all of the text to appear. Has anyone else ...

Delimiter for adding Appointment in Entourage
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC Email Client: Exchange What's the delimiter that Entourage uses if I want to add an appointment and the subject needs to be parsed by the Exchange server? <br><br>In Outlook, the hash/pound key (#) is used as delimiter. How about in Entourage 2008? <br><br>Basically, if I add an entry in a group calendar Out-Of-Office with the subject: #User1# On-Leave <br><br>in Outlook, this entry appears in the group calendar Out-Of-Office and also in User1's personal calendar. <...

AD Monitoring
Is there a listing somewhere of what all components in AD should be minitored, thresholds, etc...we are evaluating a monitoring solution and need this information to take a decision on the product to use Hello Sameer, For performance start here: http://technet.microsoft.com/en-us/library/cc961943.aspx Also see: http://technet.microsoft.com/en-us/library/bb727046.aspx Use the included links from: http://technet.microsoft.com/en-us/library/cc739728(WS.10).aspx Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties, and c...