Başka Dosyada Şifreli Userform Oluşturma isimli içerikte, ilgili işlemin VBA kodları ile nasıl yapacağınızı öğreten bir Hazır Makro Kodu yer almaktadır.
[*]Microsoft Visual Basic for Applications penceresini (Alt + F11) açın.
[*]Microsoft Excel Objects yazısının solundaki + simgesini tıklayın ve BuÇalışmaKitabı kısmına çift tıklayın.
Faydalanılması temennisiyle.
[*]Microsoft Visual Basic for Applications penceresini (Alt + F11) açın.
[*]Microsoft Excel Objects yazısının solundaki + simgesini tıklayın ve BuÇalışmaKitabı kısmına çift tıklayın.
Hazır Kod
VBA:
Public MyPass
Sub MainProgram()
MyPasswBox
If MyPass = """" Then
MsgBox ""Girilen sifre : "" & MyPass
End If
End Sub
Sub MyPasswBox()
Dim PassWForm
Set PassWForm = ThisWorkbook.VBProject.VBComponents.Add(3)
PassWForm.Properties(""Width"") = 200
PassWForm.Properties(""Height"") = 90
Set NewTextBox = PassWForm.Designer.Controls.Add(""forms.TextBox.1"")
PassWForm.Properties(""Caption"") = ""Sifre girisi !""
With NewTextBox
.Width = 120
.Height = 18
.Left = 8
.Top = 20
.PasswordChar = ""*""
.ForeColor = vbRed
End With
Set NewCommandButton1 = PassWForm.Designer.Controls.Add(""forms.CommandButton.1"")
With NewCommandButton1
.Caption = ""Vazgeç""
.Height = 18
.Width = 50
.Left = 140
.Top = 18
End With
Set NewCommandButton2 = PassWForm.Designer.Controls.Add(""forms.CommandButton.1"")
With NewCommandButton2
.Caption = ""Tamam""
.Height = 18
.Width = 50
.Left = 140
.Top = 42
End With
With PassWForm.CodeModule
X = .CountOfLines
.InsertLines X + 1, ""Sub CommandButton1_Click()""
.InsertLines X + 2, ""Unload Me""
.InsertLines X + 3, ""End Sub""
.InsertLines X + 4, ""Sub CommandButton2_Click()""
.InsertLines X + 5, ""MyPass = TextBox1""
.InsertLines X + 6, ""Unload Me""
.InsertLines X + 7, ""End Sub""
.InsertLines X + 8, ""Sub UserForm_Activate()""
.InsertLines X + 9, ""Me.SpecialEffect=3""
.InsertLines X + 10, ""End Sub""
End With
VBA.UserForms.Add(PassWForm.Name).Show
ThisWorkbook.VBProject.VBComponents.Remove VBComponent:=PassWForm
End Sub
Faydalanılması temennisiyle.
Ekli dosyalar