(1) create a form in VBA, initialize its location, and call it...
Sub CallForm ()
UserForm1.Show 'display form
UserForm1.Left = 600 'display position
UserForm1.Top = 180
End Sub
Private Sub commandbutton#click ()
CallForm 'call
End Sub
(2) font color and background color of cells in Excel
Code
Private Sub commandbutton#click ()
Dim I, j, k As Integer
J = 0
K = 0
L = 0
M = 0
For I = 1 To 10
If Cells (I, 1). Font. Color = 0 Then ', the Font Color is black.
J = j + 1
End If
If Cells (I, 1). Font. Color = 255 Then ', the Font Color is red.
K = k + 1
End If
If cells (I, 2). Interior. Color = & hffffff then', the background color is white.
L = L + 1
End if
If cells (I, 2). Interior. Color = & HFF then ', the background color is red.
M = m + 1
End if
Next I
Dim FC, BC as string
Fc = "Red =" & K & ", black =" & J
Msgbox (FC)
BC = "White =" & L & ", Red =" & M
Msgbox (BC)
End sub