Label Change Color When Text in cell is "true" on userform
Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 55

Thread: Label Change Color When Text in cell is "true" on userform

  1. #31
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    154
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    I have put your new code on my userform but not all the Labels Works

    as it should


  2. #32
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,330
    Post Thanks / Like
    Mentioned
    439 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    Can you please post the code that is not working & explain why?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #33
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    154
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    this is the second Resetlabels code i get from you
    Code:
    Sub resetLabels()   With Sheets("Cup 128")
            J = 39
          For i = 264 To 307 Step 4
             J = J + 1
             If .Range("E" & i).Value <> False Then Me.Controls("Label" & J).Caption = .Range("E" & i).Value
             If .Range("E" & i + 1).Value <> False Then Me.Controls("Label" & J + 1).Caption = .Range("E" & i + 1).Value
             Me.Controls("Label" & J).BackColor = IIf(.Range("D" & i).Value, vbRed, vbWhite)
             Me.Controls("Label" & J + 1).BackColor = IIf(.Range("D" & i + 1).Value, vbRed, vbWhite)
             J = J + 1
          Next i
          For i = 267 To 304 Step 8
             J = J + 1
             If .Range("I" & i).Value <> False Then Me.Controls("Label" & J).Caption = .Range("I" & i).Value
             If .Range("I" & i + 1).Value <> False Then Me.Controls("Label" & J + 1).Caption = .Range("I" & i + 1).Value
             Me.Controls("Label" & J).BackColor = IIf(.Range("H" & i).Value, vbRed, vbWhite)
             J = J + 1
          Next i
       End With
    End Sub
    but on my userform1 there are 16 Labels for "E" and 8 Labels for "I" and 4 Labels for "M" and 2 Labels for "R" where my Labels get there Value's
    and some of the Labels Don't show anything at all
    and some of the Labels Flash as they should
    and My commandbuttons Works
    Last edited by Hjemmet; Jul 22nd, 2019 at 08:07 AM.

  4. #34
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,330
    Post Thanks / Like
    Mentioned
    439 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    In your latest file, you have changed all the command button codes, so none of them work!
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #35
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    154
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    I take a look on it later to day

  6. #36
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,330
    Post Thanks / Like
    Mentioned
    439 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    This should do the Reset
    Code:
    Sub resetLabels()
       With Sheets("Cup 128")
            J = 39
          For i = 264 To 307 Step 6
             J = J + 1
             If .Range("E" & i).Value <> False Then Me.Controls("Label" & J).Caption = .Range("E" & i).Value
             If .Range("E" & i + 1).Value <> False Then Me.Controls("Label" & J + 1).Caption = .Range("E" & i + 1).Value
             Me.Controls("Label" & J).BackColor = IIf(.Range("D" & i).Value, vbRed, vbWhite)
             Me.Controls("Label" & J + 1).BackColor = IIf(.Range("D" & i + 1).Value, vbRed, vbWhite)
             J = J + 1
          Next i
          For i = 267 To 304 Step 12
             J = J + 1
             If .Range("I" & i).Value <> False Then Me.Controls("Label" & J).Caption = .Range("I" & i).Value
             If .Range("I" & i + 1).Value <> False Then Me.Controls("Label" & J + 1).Caption = .Range("I" & i + 1).Value
             Me.Controls("Label" & J).BackColor = IIf(.Range("H" & i).Value, vbRed, vbWhite)
             Me.Controls("Label" & J + 1).BackColor = IIf(.Range("H" & i + 1).Value, vbRed, vbWhite)
             J = J + 1
          Next i
          For i = 273 To 298 Step 24
             J = J + 1
             If .Range("M" & i).Value <> False Then Me.Controls("Label" & J).Caption = .Range("M" & i).Value
             If .Range("M" & i + 1).Value <> False Then Me.Controls("Label" & J + 1).Caption = .Range("M" & i + 1).Value
             Me.Controls("Label" & J).BackColor = IIf(.Range("L" & i).Value, vbRed, vbWhite)
             Me.Controls("Label" & J + 1).BackColor = IIf(.Range("L" & i + 1).Value, vbRed, vbWhite)
             J = J + 1
          Next i
          For i = 285 To 286 Step 2
             J = J + 1
             If .Range("R" & i).Value <> False Then Me.Controls("Label" & J).Caption = .Range("R" & i).Value
             If .Range("R" & i + 1).Value <> False Then Me.Controls("Label" & J + 1).Caption = .Range("R" & i + 1).Value
             Me.Controls("Label" & J).BackColor = IIf(.Range("Q" & i).Value, vbRed, vbWhite)
             Me.Controls("Label" & J + 1).BackColor = IIf(.Range("Q" & i + 1).Value, vbRed, vbWhite)
             J = J + 1
          Next i
       
       End With
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  7. #37
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    154
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    Again you DID it....

    Thank YOU so much for your Time to Figure IT out

    it WORKS like a Shinning Diamond

  8. #38
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,330
    Post Thanks / Like
    Mentioned
    439 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  9. #39
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    154
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    A Single option

    on my userform1 after the new Code i got it works as it should be

    i need a little option wher Label 70 Shows Me Who's the Winner is, it Possibel Just to Get the Winner Show in My Label70
    right now my Label68 and 69 show the Player with Red Bagground as the looser of the Game

    Label70 looks on Cell "R285" and "R286"
    Last edited by Hjemmet; Jul 22nd, 2019 at 04:58 PM.

  10. #40
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    25,330
    Post Thanks / Like
    Mentioned
    439 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Label Change Color When Text in cell is "true" on userform

    You can just add a line of code into the last two commandbuttons, to change the caption of Label70
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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