این کد قفل کلید
کد:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim rngCell As Range
If Not Application.Intersect(Target, Me.Range("c1:c10")) Is Nothing Then
For Each rngCell In Application.Intersect(Target, Me.Range("c1:c10"))
If Me.Cells(rngCell.Row, "A").Value <> "Pending" Then
Application.OnKey "{DEL}", ""
Application.OnKey "{BACKSPACE}", ""
Exit For
Else
Application.OnKey "{DEL}"
Application.OnKey "{BACKSPACE}"
End If
Next rngCell
Else
Application.OnKey "{DEL}"
Application.OnKey "{BACKSPACE}"
End If
End Sub
اینم کد یورز فرم
کد:
Private Sub CommandButton1_Click()
If TextBox1.Text = ComboBox1.Column(1) Then
MsgBox (" ÎæÔ ÂãÏíÏ " + ComboBox1.Column(0))
If ComboBox1.Column(0) = "ADMIN" Then
Sheet1.Visible = xlSheetVisible
Sheet2.Visible = xlSheetVisible
Sheet3.Visible = xlSheetVisible
Sheet1.Select
Application.Windows.Application.Visible = True
End
ElseIf ComboBox1.Column(0) = "A" Then
Sheet2.Visible = xlSheetVisible
Sheet2.Select
End
ElseIf ComboBox1.Column(0) = "B" Then
Sheet3.Visible = xlSheetVisible
Sheet3.Select
End
End If
Else
MsgBox ("äÇã ˜ÇÑÈÑí íÇ ÑãÒ Ú龄 ÇÔÊÈÇå ÇÓÊ")
End If
End Sub
علاقه مندی ها (Bookmarks)