Sekedar informasi,
Kondisi: A1 = 0 atau blank
Pada Name Box (sebelah kiri Formula Bar)
ketik B5:B6 kemudian tekan Enter
Ketik sembarang
Simpulan: meski A1 = 0, kita masih dapat menginput range B5:B6
>semoga bermanfaat
Kondisi: A1 = 0 atau blank
Pada Name Box (sebelah kiri Formula Bar)
ketik B5:B6 kemudian tekan Enter
Ketik sembarang
Simpulan: meski A1 = 0, kita masih dapat menginput range B5:B6
>semoga bermanfaat
From: siti Vi <setiyowati.devi@
To: XL-mania@yahoogroup
Sent: Thu, January 7, 2010 8:25:22 AM
Subject: Re: ]] XL-mania [[ mengunci dan mengunci
(1)
Private Sub CommandButton1_ Click()
'-- sitiVi / membuat sheet baru --
Dim LembarBaru As Worksheet
Dim NamaSheet As String
NamaSheet = InputBox(Prompt: ="Tuliskan Nama Sheet.", _
Title:="Membuat Sheet Baru")
If Len(NamaSheet) = 0 Then Exit Sub
Set LembarBaru = Worksheets.Add
LembarBaru.Name = NamaSheet
LembarBaru.Move After:=Sheets( Sheets.Count)
'-- sitiVi / membuat sheet baru --
Dim LembarBaru As Worksheet
Dim NamaSheet As String
NamaSheet = InputBox(Prompt: ="Tuliskan Nama Sheet.", _
Title:="Membuat Sheet Baru")
If Len(NamaSheet) = 0 Then Exit Sub
Set LembarBaru = Worksheets.Add
LembarBaru.Name = NamaSheet
LembarBaru.Move After:=Sheets( Sheets.Count)
End Sub
(2)
Private Sub Worksheet_Selection Change(ByVal Target As Range)
' siti Vi / me-LOCKED range tertentu berdasarkan kondisi teetentu
With Target
If .Cells.Count = 1 Then
If .Address = "$B$5" Or .Address = "$B$6" Then
If Range("A1"). Value = 0 Or Range("A1"). Value = "0" Then
Me.Unprotect "VDA"
Me.Cells.Locked = False
Range("B5:B6" ).Locked = True
Me.Protect "VDA"
Else
Me.Unprotect "VDA"
Range("B5:B6" ).Locked = False
End If
Else
Me.Unprotect "VDA"
Me.Cells.Locked = False
End If
End If
End With
End Sub
With Target
If .Cells.Count = 1 Then
If .Address = "$B$5" Or .Address = "$B$6" Then
If Range("A1"). Value = 0 Or Range("A1"). Value = "0" Then
Me.Unprotect "VDA"
Me.Cells.Locked = False
Range("B5:B6" ).Locked = True
Me.Protect "VDA"
Else
Me.Unprotect "VDA"
Range("B5:B6" ).Locked = False
End If
Else
Me.Unprotect "VDA"
Me.Cells.Locked = False
End If
End If
End With
End Sub
3 menyembunyikan mudule code
lihat di worksheet lampiran (sheet 2 / cell D26:D27 )
----- Original Message -----From: Vidi ArdyantoSent: Wednesday, January 06, 2010 4:21 PMSubject: ]] XL-mania [[ mengunci dan mengunciTemans,
Minta referensi code makro utk case2 berikut donk :
1. Membuat sheet baru dg menekan Command button.
kondisi : - sheet baru ada di workbook yg sama.
- nama sheet diinput oleh user
- posisi sheet baru diletakkan di paling kanan (move to end)
- command button ikut tercopy jg di sheet yg baru ( code jg bisa dijalanin di sheet yg baru )
- data inputan ( misal di range B4:B10 ) direset jadi kosong lagi
- Active cell ada di sheet baru cell B4
2. Mengunci cell tertentu pada kondisi tertentu.
kondisi : - misal if A1=0 ---> Range B5:B6 tidak bisa diinput
- ketika coba diinput keluar ceramah kyk gini misal " it is not necessary to be inputed, not applicable boss..."
- warna range dibikin jadi gray pada kondisi tsb
- kondisi berubah normal kembali ketika syarat tidak terpenuhi lg
3. Mengunci code yg kita bikin
kondisi : - ketika ada user mau coba lihat/mengedit codenya, dia harus punya password.
sementara ini dulu.. :D:D:D
cheers,
__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Resolusi 2010 XL-mania: terbitkan buku lagi... hehehe... |
| 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 |
+-------------------------------------------------------------------+
| Resolusi 2010 XL-mania: terbitkan buku lagi... hehehe... |
| 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 |
+-------------------------------------------------------------------+
.
__,_._,___
Nenhum comentário:
Postar um comentário