Excel VBA: Change Cell's Background Color With Userform
The scrollbar's min value is 0, the maximum value is 56.
The related VBA codes:
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub ScrollBar1_Change()
TextBox1.Value = ScrollBar1.Value
Selection.Interior.ColorIndex = ScrollBar1.Value
End Sub
Private Sub UserForm_Initialize()
ScrollBar1.Min = 0
ScrollBar1.Max = 56
End Sub
Unload Me
End Sub
Private Sub ScrollBar1_Change()
TextBox1.Value = ScrollBar1.Value
Selection.Interior.ColorIndex = ScrollBar1.Value
End Sub
Private Sub UserForm_Initialize()
ScrollBar1.Min = 0
ScrollBar1.Max = 56
End Sub
No comments:
Post a Comment