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

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
180
HM HM HM i thanks for the idea But that Combo stuff give me LONG hair

but give it a try any way

thanks for you help So Far
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
180
I have now Try you Solution and put code in and made a Single userform And combo work but code stop with error in this Line

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[COLOR=#ffff00] [/COLOR][COLOR=#ff0000]Me.Controls("Label" & j).Caption = .Range("E" & i).Value[/COLOR][COLOR=#ffff00][/COLOR]
         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
 

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
180
I must SAY that Was Brilliant

i thanks for that Idea and will use it for my Big file Later with Lots of Game Solutions

SO Thanks Again for you help
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,820
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
180
Hey Fluff First of all Thanks Again for Your Help so far..

the first 1-8 works Brilliant

but i Need some help with the Last And most Importen Board "The Finale Games from the last 16 Players who run Through Round 1 to 8

and on that Userform there are NO textbox's Only Labels from Label40 to Label69
Label40 to Label55 takes data from "E264 to E306" 16 players left 1/8 Finale)
Label56 to Label63 takes data from "I267 to E304" 8 Players left (Quarter Finale)
Label64 to Label67 takes data from "M273 to M298" 4 Players left (semi Finale)
Label68 to Label69 takes data from "R265 to R266" 2 Players left (Finale)

Label70 came by read cell where Vwinner is

and Same numbers of Commandbuttons (CB) start from
CB40 for Label40 to CB55 for Label55
CB56 for Label56 to CB63 for label63
CB64 for Label64 to CB67 for Label67
CB68 for Label68 to CB69 for Label69

Hope that was enough
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,820
Office Version
365
Platform
Windows
Use this
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
This will get rid of the problem when loading the form, but some of your commandbuttons are looking at the labels/buttons
 

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
180
thanks THAT was fast

i take a look on my Commandbuton/labels when i get Home from Job
 

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
180
Code:
https://www.dropbox.com/s/u87vnpomy0nfenj/total%20changes.xlsm?dl=0
new link to my file Just try it at Work after i got some spare time (LOL)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,820
Office Version
365
Platform
Windows
Is it working?
If not what problems do you get?
 

Watch MrExcel Video

Forum statistics

Threads
1,102,615
Messages
5,487,882
Members
407,613
Latest member
JeffFinnan

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top