Hi guys,
I am creating an useform, where I have more then 60 labels.
I do not want to write 56-times the below written code and everywhere change number of label. Is it possible instead of this make one macro?
VB Code:
Private Sub Label1_Click() UserForm1.Controls(labelname).SpecialEffect = fmSpecialEffectFlat labelname = "label1" UserForm1.Label1.SpecialEffect = fmSpecialEffectSunken GetRGB UserForm1.Label1.BackColor, Red, Green, Blue RGBToHSL UserForm1.TextBox4.Value = Red UserForm1.TextBox5.Value = Green UserForm1.TextBox6.Value = Blue UserForm1.TextBox1.Value = H UserForm1.TextBox2.Value = S UserForm1.TextBox3.Value = L UserForm1.SpinButton1.Value = H UserForm1.SpinButton2.Value = S UserForm1.SpinButton3.Value = L UserForm1.SpinButton4.Value = Red UserForm1.SpinButton5.Value = Green UserForm1.SpinButton6.Value = Blue UserForm1.Label63.BackColor = UserForm1.Label1.BackColor End Sub
Boris




Reply With Quote