Sub Sample() Dim code As Integer code = InputBox("色番号(0〜15)を指定してください") If IsNumeric(code) Then Me.BackColor = QBColor(code) End If End Sub