gringo287
04-07-2013, 01:27 PM
Hi,
I have an existing userform that's all working fine etc, but i need to be able to 1/ enable users to adjust the colour to suit their needs 2/ change the targets of the stats that the userform tracks, so i don't need to keep updating it myself.
"2" Is easy and that's working fine with a few spinbuttons linked to cells etc
"1" I'm 90% there as I've just set up coloured command buttons that change the colour of the userform to the respective colour selected. Now,I'm stumped with how to get the userform initialize event, to pick up what colour was selected last time. I was thinking of referring to the relevant colour selected in a cell, but dont know where to go from there. Using the example below places "16777215" in the cell
Private Sub Cmd2_Click()
Application.ScreenUpdating = False
With ThisWorkbook.Sheets("KpiTracker")
.Range("M1").Value = RGB(255, 255, 255)
UserForm4.BackColor = RGB(255, 255, 255)
UserForm1.BackColor = RGB(255, 255, 255)
LblB1Targets.ForeColor = RGB(255, 0, 0)
LblB2Targets.ForeColor = RGB(255, 0, 0)
LblB3Targets.ForeColor = RGB(255, 0, 0)
LblAcwTargets.ForeColor = RGB(255, 0, 0)
LblBox1Target.ForeColor = RGB(255, 0, 0)
LblBox2Target.ForeColor = RGB(255, 0, 0)
LblBox3Target.ForeColor = RGB(255, 0, 0)
LblAcwTarget.ForeColor = RGB(255, 0, 0)
I have an existing userform that's all working fine etc, but i need to be able to 1/ enable users to adjust the colour to suit their needs 2/ change the targets of the stats that the userform tracks, so i don't need to keep updating it myself.
"2" Is easy and that's working fine with a few spinbuttons linked to cells etc
"1" I'm 90% there as I've just set up coloured command buttons that change the colour of the userform to the respective colour selected. Now,I'm stumped with how to get the userform initialize event, to pick up what colour was selected last time. I was thinking of referring to the relevant colour selected in a cell, but dont know where to go from there. Using the example below places "16777215" in the cell
Private Sub Cmd2_Click()
Application.ScreenUpdating = False
With ThisWorkbook.Sheets("KpiTracker")
.Range("M1").Value = RGB(255, 255, 255)
UserForm4.BackColor = RGB(255, 255, 255)
UserForm1.BackColor = RGB(255, 255, 255)
LblB1Targets.ForeColor = RGB(255, 0, 0)
LblB2Targets.ForeColor = RGB(255, 0, 0)
LblB3Targets.ForeColor = RGB(255, 0, 0)
LblAcwTargets.ForeColor = RGB(255, 0, 0)
LblBox1Target.ForeColor = RGB(255, 0, 0)
LblBox2Target.ForeColor = RGB(255, 0, 0)
LblBox3Target.ForeColor = RGB(255, 0, 0)
LblAcwTarget.ForeColor = RGB(255, 0, 0)