Mister programnya belum sesuai dgn keinginan saya 

 ketika saya menuliskan kode ini pada sebuah userform
 

 Private Sub CommandButton1_Click()
 Dim myCode As String
 ProsesHookInputBox "*"
 myCode = InputBox("Please Insert Your Password to Edit This Worksheet..", 
"Insert Password")
 ProsesHookInputBox
 If StrPtr(myCode) = 0 Then  'Klik cancel atau close dialog (do nothing)
 ElseIf LenB(myCode) = 0 Then  'Not Fill -> press OK (do nothing)
 ElseIf myCode = "123" Then   'Fill 123 -> OK
 MsgBox "Good...Your Password is Match", vbInformation, "Your Password"
 'seharusnya prosedur Workbook_SheetChange Active ketika password yang 
diketikan bernilai True, prosedur nya
 Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
 Dim Target As String
 Target.Font.Color = vbBlue
 End Sub
 Else   'user mengisi suatu teks yang bukan berbunyi 123 lalu menekan OK
 MsgBox "Sorry...Your Password is not Match !!!" & vbCrLf & _
 "You Can't Edit This Worksheet", vbCritical, "Your Password"
 End If
 End Sub
 

 Dia akan kembali normal ketika Workbook di open kembali.
 

 

 Sub Workbook_Open()
 UserForm1.Show
 Call Normal
 End Sub
 

 Normal merupakan module1
 

 Private Sub Normal()
 Dim sht As Worksheet
 For Each sht In ThisWorkbook.Worksheets
    sht.Cells.Font.ColorIndex = xlAutomatic
 Next sht
 End Sub

 

 Masalahnya:

 Prosedur normal sudah berfungsi tetapi prosedur Workbook_SheetChange belum 
berfungsi sesuai harapan saya yaitu (Workbook_SheetChange aktif ketika password 
pada input box bernilai True)

 

 Mohon bantuannya mister
 


 

 

Kirim email ke