Private Sub ComboBox1_Change() If Me.ComboBox1.Value <> "" Then Me.TextBox1.SetFocus End Sub
Private Sub CommandButton1_Click() Dim j As Integer, i As Integer Dim Arr() As Variant Arr = [{"abc","557","xyz","731","esa","zpe","ycd","acd"}] With Me.ComboBox1 If .Value <> "" Then j = .ListIndex + 1 For i = 1 To j - 1 If ActiveSheet.Shapes("Picture " & i).Visible = False Then MsgBox "선결재자중 결재되지 않은 부분이 있습니다.", vbCritical, "결재 오류~" Unload Me Exit Sub End If Next i If Me.TextBox1.Text = Arr(j) Then ActiveSheet.Shapes("Picture " & j).Visible = True Else MsgBox "암호가 틀립니다.", vbCritical, "암호 불일치" End If Else MsgBox "결재자를 선택하시지 않으셨습니다.", vbCritical, "선택 오류~" Exit Sub End If End With Unload Me End Sub
Private Sub CommandButton2_Click() Unload Me End Sub
Private Sub UserForm_Initialize() Dim rng As Range, c As Range Set rng = Range("e2", Range("e2").End(xlToRight)) For Each c In rng Me.ComboBox1.AddItem c.Value Next c Me.TextBox1.PasswordChar = "*" End Sub