Selasa, 25 November 2014

Protect Worksheet in Ms. Excel

08.43

Cara untuk memprotect worksheet excel sehingga sheet hanya bisa read only
Buka Ms Excel > rename sheet1=contoh
klik tab developer>visual basic>klik 2x pada worksheet contoh
ketikkan kode berikut di worksheet contoh

Private Sub Worksheet_Activate()
Dim contoh As Worksheet
Dim myPassword As String
myPassword = "password"
For Each Sh In ActiveWorkbook.Worksheets
contoh.Protect Password:=myPassword
Next contoh
End Sub

Agar sheet di excel bisa di edit harus ketikkan kode berikut di lembar module pada visual basic editor:

Sub UnprotectAll()
Dim contoh As Worksheet
Dim myPassword As String
myPassword = "password"
For Each contoh In ActiveWorkbook.Worksheets
contoh.Unprotect Password:=myPassword
Next Sh
End Sub

untuk membuka worksheet yang telah dikunci, setelah menulis coding diatas kita tinggal memanggil fungsi diatas akan mengedit dengan mengetikan coding sbg berikut:

call UnprotectAll


Semoga bermanfaat.

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 komentar:

Posting Komentar

 

© 2013 Amanah Fitri. All rights resevered. Designed by Templateism

Back To Top