Tecnologia, programação e muito Visual FoxPro.

domingo, 26 de julho de 2009

Re: ]] XL-mania [[ two coloum password with different password....excel 2003

 

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(ColNo As Integer) As Boolean
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_SelectionChange(ByVal Target As Range)
If Target.Column = 3 Then
If isEditC = False Then
If UserValidation(Target.Column) Then
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(Target.Column) Then
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_Deactivate()
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...



On Sat, Jul 25, 2009 at 8:23 AM, Zigen X <zigenx@yahoo.com.sg> wrote:
 

HI XL Mania,
How to create two different password protected coloum ?
Password should be different because it will be edited by two different users...
Please explain and thanks in advance......refer to the attachment for more info...
 
Rgds,

__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| 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              |
+-------------------------------------------------------------------+
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Yahoo! Groups

Mom Power

Find wholesome recipes

and more. Go Moms Go!

Yahoo! Groups

Small Business Group

Ask questions,

share experiences

.

__,_._,___

Nenhum comentário:

Arquivo do blog