Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 55

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

  1. #41
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    170
    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 now try to put my code where the Command Button is for Label70 and that works as Brilliant

    and of course i figure out i miss some Part where i get the Value from 8 other Cell's witch tell me Who is the Referee at The Game for the last 16 Players

    i have I set this Code for each NEW label's from 71-79 with this code and value is First show when i Click on label

    Code:
    Private Sub Label71_Click()Me.Label71.Caption = ThisWorkbook.Sheets("Cup 128").Range("E267")
    resetLabels
    End Sub
    as i self can see it because this line "Private Sub Label71_Click()" but cant figure out how to make it Auto update when Userform is Show

    and i have try it with "resetLabels" but aint work....

  2. #42
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,353
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

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

    As this is now a different question, you will need to start a new thread.
    Thanks
    - 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. #43
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    170
    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 do That ��

  4. #44
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    170
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

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

    Hey Fluff..

    I have now Running my Userform through for mistakes and in first time nothing wrong But second Running through userform and Functions i ran into few mistakes



    mistake was if example (Round8) was played Longer than another (Round's) and i start Userform and those (Round1) and None of those games where played Then i can see Players from (Round8)
    and it is on all of them that give that Mistake

    i have make a Sheet next to they Original file
    Code:
    https://www.dropbox.com/s/oo0jqtg9hjylg56/total%20changes%20with%20description.xlsm?dl=0

  5. #45
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,353
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

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

    That's because you only change the labels if <> false.
    You also need to change clear the label if the cell value is false.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  6. #46
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    170
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

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

    Well that make sence i take a look at it on sonday

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

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

    im sorry to say BUT i aint figure it out what to change and where

    i have try to change False to True and then the Value Aint Show on label only "False" show's in label and that might because the "Formula in Cell where Label has the Reference to Give False Result

    Hope you could or will Help me with that Part too...

    Only the Label Function of course

  8. #48
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,353
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

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

    Do it like
    Code:
          For i = Rw + 2 To Rw + 27 Step 8
             J = J + 1
             Me.Controls("Label" & J).Caption = IIf(.Range("I" & i).Value = False, "", .Range("I" & i).Value)
             Me.Controls("Label" & J + 1).Caption = IIf(.Range("I" & i + 1).Value = False, "", .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
    - 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. #49
    Board Regular
    Join Date
    Jun 2018
    Location
    Denmark
    Posts
    170
    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 dont know what i am doing wrong But i can get it to work

    so i am near to give up my Project
    this is the Code Before new Change's

    Code:
    Sub resetLabels()   With Sheets("Cup 128")
          For i = Rw To Rw + 29 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 = Rw + 2 To Rw + 27 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)
             Me.Controls("Label" & J + 1).BackColor = IIf(.Range("H" & i + 1).Value, vbRed, vbWhite)
             J = J + 1
          Next i
          For i = Rw + 6 To Rw + 23 Step 16
             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
       End With
    End Sub
    so code look's like this
    Code:
    Sub resetLabels()   With Sheets("Cup 128")
          For i = Rw To Rw + 29 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 = Rw + 2 To Rw + 27 Step 8
             J = J + 1
             Me.Controls("Label" & J).Caption = IIf(.Range("I" & i).Value = False, "", .Range("I" & i).Value)
             Me.Controls("Label" & J + 1).Caption = IIf(.Range("I" & i + 1).Value = False, "", .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 = Rw + 6 To Rw + 23 Step 16
             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
       End With
    End Sub
    i have try to change for the next Part But wont work that part i try to changes is in Green the Red Part Works
    Last edited by Hjemmet; Jul 28th, 2019 at 04:09 PM. Reason: Missing info

  10. #50
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,353
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

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

    You just need to change the first two lines of the green section, the same way I did for the red.
    - 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
  •