+ Reply to Thread
Results 1 to 3 of 3

Color Scheme Help

Hybrid View

  1. #1
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,935

    Re: Color Scheme Help

    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim Ndx         As Long
        Dim TeamColor   As Double, _
            FontColor   As Double, _
            ColorVals   As Variant
            
        Ndx = WorksheetFunction.Match(Target.Value, Sheets("opponent").Range("A1:A30"), 0)
        
        TeamColor = Worksheets("opponent").Cells(Ndx, 1).Interior.Color
        FontColor = Worksheets("opponent").Cells(Ndx, 1).Font.Color
        
        ColorVals = Split(rgb3(TeamColor), ",")
    
        Range(Target.Address(0, 0)).Interior.Color = RGB(CLng(ColorVals(0)), CLng(ColorVals(1)), CLng(ColorVals(2)))
        Range(Target.Address(0, 0)).Font.Color = FontColor
    End Sub
    and this from Marcol (2011?)
    Public Function rgb3(ByVal ColorVal As Long) As String
        Dim R As Long
        Dim G As Long
        Dim B As Long
        Dim RGB As Long
        R = ColorVal And 255
        G = ColorVal \ 256 And 255
        B = ColorVal \ 256 ^ 2 And 255
        rgb3 = R & "," & G & "," & B
    End Function
    One last thing is on the Chicago Bulls tab. Cells B21:B35 have a data validation and the roster changes dynamically. I want to be able to hide cell B35 (or any other cell in that data validation range) if there is not an entry A21:A35.
    1. Created named formula OpponentManList: " =IF('Chicago Bulls'!$A21<>"",temp) "
    2. Created named range temp for range: $P$21:$37
    3. Created conditional data validation in B21:B35: " =OpponentManList "
    Attached Files Attached Files
    Ben Van Johnson

+ 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