Results 1 to 6 of 6

Thread: Excel 2010 IF Statements/Conditional Formatting

  1. #1
    Yer Da Sells Avon! keef247's Avatar
    Join Date
    Dec 2005
    Location
    Brownsville
    Posts
    1,437
    Thanks
    201
    Thanked
    27 times in 23 posts

    Question Excel 2010 IF Statements/Conditional Formatting

    Hi guys,
    just a quick one as it's been awhile since I've used IF statements and conditional formatting...
    basically I want to use the key as pictured here to highlight and fill the F column accordingly based upon the key's fields.

    I want the colours to be filled as per the key also.

    Cheers!
    Quote Originally Posted by Fraz regarding the Apple Mighty Mouse
    I just got so fed up with this thing for it's crappy erratically working scroll ball and poor right-click detection that I just threw it against a wall and it exploded.

    Good riddance. Wish I'd done it about a year ago.

  2. #2
    Registered+
    Join Date
    Sep 2014
    Posts
    33
    Thanks
    4
    Thanked
    8 times in 8 posts

    Re: Excel 2010 IF Statements/Conditional Formatting

    not done much excel recently(long time ago) but logically looks like you are approaching this the wrong way,
    the test should be whether or not there is a value in d2 and the resulting true value should be a ref to the formatting not the value held in the cell

  3. #3
    Senior Member
    Join Date
    Oct 2009
    Posts
    269
    Thanks
    45
    Thanked
    30 times in 26 posts
    • cookie365's system
      • Motherboard:
      • Asus H87M Plus
      • CPU:
      • i3 4340
      • Memory:
      • 2x Kingston HyperX 4Gb
      • Storage:
      • 250Gb Samsung SSD 840 EVO + Seagate 1TB + WD Green 2TB
      • Graphics card(s):
      • Whatever comes with the i3
      • PSU:
      • bequiet StraightPower 600
      • Case:
      • Aquacool Dead Silence
      • Operating System:
      • W10
      • Monitor(s):
      • Rectangular
      • Internet:
      • Cable

    Re: Excel 2010 IF Statements/Conditional Formatting

    It's not very elegant, but you could try something along the lines of

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        With Sheet1
            For Each rCell In .Range("F2:F500")
                If rCell.Value = "com" Then
                    rCell.Interior.Color = RGB(69, 139, 0)
                ElseIf rCell.Value = "fin" Then
                    rCell.Interior.Color = RGB(75, 0, 130)
                ElseIf rCell.Value = "sup" Then
                    rCell.Interior.Color = RGB(255, 255, 0)
                ElseIf rCell.Value = "nfa" Then
                    rCell.Interior.Color = RGB(0, 0, 0)
                 ElseIf rCell.Value = "cust" Then
                    rCell.Interior.Color = RGB(70, 130, 180)
                ElseIf rCell.Value = "3rd" Then
                    rCell.Interior.Color = RGB(255, 165, 0)
                ElseIf rCell.Value = "og" Then
                    rCell.Interior.Color = RGB(240, 128, 128)
                Else
                    rCell.Interior.Color = RGB(255, 255, 255)
                End If
            Next rCell
        End With
    End Sub

  4. #4
    Yer Da Sells Avon! keef247's Avatar
    Join Date
    Dec 2005
    Location
    Brownsville
    Posts
    1,437
    Thanks
    201
    Thanked
    27 times in 23 posts

    Re: Excel 2010 IF Statements/Conditional Formatting

    I did a similar thing years ago which was something like IF F2=X then FILL Colour Insert text X etc the above doesn't look familiar at all :\
    Quote Originally Posted by Fraz regarding the Apple Mighty Mouse
    I just got so fed up with this thing for it's crappy erratically working scroll ball and poor right-click detection that I just threw it against a wall and it exploded.

    Good riddance. Wish I'd done it about a year ago.

  5. #5
    LUSE Galant's Avatar
    Join Date
    Oct 2003
    Location
    Gibraltar
    Posts
    3,252
    Thanks
    502
    Thanked
    555 times in 339 posts

    Re: Excel 2010 IF Statements/Conditional Formatting

    Seems like something's missing in your explanation. If I'm reading it right you want the text and colour from a cell in Column H to appear in column F. However, unless I'm missing it, you haven't specified the triggers for that action.

    So the question is, based on what do you want column F to be filled from Column H?

    e.g. - Would I be right in assuming that you would want the cell in F to be filled with "com" (green) when the Cell in D (actual completion date) is filled?
    Not sure how some of those would be triggered.
    No trees were harmed in the creation of this message. However, many electrons were displaced and terribly inconvenienced.

  6. #6
    Yer Da Sells Avon! keef247's Avatar
    Join Date
    Dec 2005
    Location
    Brownsville
    Posts
    1,437
    Thanks
    201
    Thanked
    27 times in 23 posts

    Re: Excel 2010 IF Statements/Conditional Formatting

    yes mate that's pretty much it to a t. if F = H's com then fill F with 'complete' etc
    Quote Originally Posted by Fraz regarding the Apple Mighty Mouse
    I just got so fed up with this thing for it's crappy erratically working scroll ball and poor right-click detection that I just threw it against a wall and it exploded.

    Good riddance. Wish I'd done it about a year ago.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •