안녕하세요?
이전에 만들어 뒀던 자료입니다.
유저폼을 이용해서 전자결재 흉내내기입니다...
자세한 내용은 아래 첨부파일을 확인해 보세요.
==========================================
첨부파일
==========================================
Option Explicit
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
그럼...!