+ Reply to Thread
Results 1 to 35 of 35

More than 3 formatting conditions - select case?

Hybrid View

  1. #1
    Registered User
    Join Date
    09-18-2008
    Location
    Devon
    MS-Off Ver
    2002
    Posts
    71
    OK, so if I do paste special and just get the values, will that work?

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Try the below link.. may be of help to you

    http://www.excelforum.com/excel-gene...-than-3-a.html

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If you manually enter the value in P then this code works fine

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range
    Dim intColour As Integer
        
        If Target.Column = 16 And Target.Count = 1 Then
            Select Case Cells(Target.Row, 16).Value
                Case 1: intColour = 3
                Case 2: intColour = 8
                Case 3: intColour = 4
                Case 5: intColour = 46
                Case Else:    'do nothing
            End Select
        End If
        Set rng = ActiveSheet.Range(Cells(Target.Row, 8), Cells(Target.Row, 13))
          rng.Interior.ColorIndex = intColour
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1