Results 1 to 2 of 2

Odd Background shading behavior And Error Checking

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Odd Background shading behavior And Error Checking

    Hello, I was hoping someone could tell me why, the code below is inserted in my worksheet, when multiple cells are selected and cleared by right clicking and selecting "clear contents" they are shaded the color for the "OFF" Case, but when the same steps to clear are performed on only one cell it remains white? Also if you could suggest some changes so that when the cells are cleared I do not get a Type Mismatch error, that would be great.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim icolor As Integer
    
     On Error Resume Next
     
    'change the conditions below
      Select Case Target.Value
               Case "OFF"
                    icolor = 35
                Case "RTO"
                    icolor = 8
                Case "vacation"
                    icolor = 8
                Case "10-9 SBP"
                    icolor = 38
                Case ""
                    icolor = 2
                Case Else
            End Select
      
      Target.Interior.ColorIndex = icolor
     
    
    End Sub

    Thanks!
    Clayton Grove
    Last edited by dcgrove; 11-11-2008 at 11:09 PM.

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