in worksheets' protection we have single password only for 1 sheet,
(maksodku : di sheets, kita hanya punya 1 password untuk 1 sheet
yaitu ketika kita memproteksi worksheet)
no password for specific range.
(maksodku : dari sono-nya, Range itu ndak bisa dipasangi password,
kalo dipasangi "susuk" mungkin bisa...)
so you have to do this task (pass word for difference columns) by makro
CMIIW
(maksodku: jadi kerjaan spt itu kayaknya hanya bisa di kerjakan
dengan makroh..)
Colek Me If I'm Wrong
------------
assuming: Column_1 = C column, Column_2 = E column
'===makro in Standard MODULE===
Public Const SheetPswd As String = "ZIGEN" '<<-- please reName
Public Const passC As String = "passforC" '<<-- please reName
Public Const passE As String = "passforE" '<<-- please reName
Public isEditC As Boolean
Public isEditE As Boolean
Function UserValidation(
Dim pswd As String
Dim passX As String
passX = IIf(ColNo = 3, passC, passE)
pswd = InputBox("Your Password for this column editing:", _
"User Validation", "YourPassWord")
UserValidation = IIf(pswd = passX, True, False)
End Function
'=== makro in Object Module for Sheet1 ====
Private Sub Worksheet_Selection
If Target.Column = 3 Then
If isEditC = False Then
If UserValidation(
Me.Unprotect SheetPswd
Me.Cells.Locked = True
Range("C:C").Locked = False
isEditC = True
isEditE = False
Else
MsgBox "Wrong Password !!", 48, "UserValidation"
End If
End If
ElseIf Target.Column = 5 Then
If isEditE = False Then
If UserValidation(
Me.Unprotect SheetPswd
Me.Cells.Locked = True
Range("E:E").Locked = False
isEditE = True
isEditC = False
Else
MsgBox "Wrong Password !!", 48, "UserValidation"
End If
End If
ElseIf Target.Column <> 3 Or Target.Column <> 5 Then
Me.Unprotect SheetPswd
Me.Cells.Locked = True
isEditC = False
isEditE = False
Me.Protect SheetPswd
End If
End Sub
Private Sub Worksheet_Deactivat
Me.Protect SheetPswd
End Sub
Om-Om members,
tolong dong bilangin ke bule ini, untuk lebih amannya
VBA-projectnya bisa di LOCK-FOR-VIEWING
supaya user ndak bisa ngintip variable password-nya.
| XL-mania, berjuang untuk rakyat, pancen oyeeee, LANJUTKAN! |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message, melecehkan, tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan winzip jika perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/ |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau... |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html |
+-------------------------------------------------------------------+
| Message lama ada di : |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id] |
| http://www.mail-archive.com/xl-mania@yahoogroups.com |
+-------------------------------------------------------------------+
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Nenhum comentário:
Postar um comentário