السلام عليكم
اخي العزيز
هذا هو الكود بعد التعديل البسيط
Private Sub CommandButton1_Click()
Range("hh3") = TextBox1.Value
If Range("hh3") = Range("hh3") Then
MsgBox "that;sright", vbOKOnly, ""
Cells.Select
Selection.EntireColumn.Hidden = False
Rows("10:1010").Select
Selection.Sort Key1:=Range("B10"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End
Else
MsgBox " wrong password " & Chr(13) & "sorry", vbOKOnly + vbMsgBoxRtlReading + vbMsgBoxRight, ""
End
End If
End Sub
وهذا كود اخر دون اللجوء للكتابة داخل خلية بالشيت
Private Sub CommandButton1_Click()
If TextBox1 = "123" Then
MsgBox "that;sright", vbOKOnly, ""
Cells.Select
Selection.EntireColumn.Hidden = False
Rows("10:1010").Select
Selection.Sort Key1:=Range("B10"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End
Else
MsgBox " wrong password " & Chr(13) & "sorry", vbOKOnly + vbMsgBoxRtlReading + vbMsgBoxRight, ""
End
End If
End Sub
ارجو اخباري بالنتيجة
تحياتي