. افتح محرر VBA:
اضغط Alt + F11
من القائمة: Insert → Module
Sub بدء_النظام()
Dim nomUtilisateur As String
Dim motDePasse As String
Dim cellule As Range
Dim derLigne As Long
Dim ligne As Long
Dim feuille As Worksheet
Dim trouve As Boolean
Set feuille = ThisWorkbook.Sheets("Feuil1") ' غيّر اسم الورقة إذا لزم
nomUtilisateur = InputBox("أدخل اسم المستخدم:")
If nomUtilisateur = "" Then Exit Sub
motDePasse = InputBox("أدخل الرقم السري:")
If motDePasse = "" Then Exit Sub
' تحقق من صحة المستخدم (مثال بسيط: الاسم = الرقم السري)
If nomUtilisateur <> motDePasse Then
MsgBox "اسم المستخدم أو كلمة السر غير صحيحة!", vbCritical
Exit Sub
End If
' إظهار كل الصفوف أولاً
feuille.Rows.Hidden = False
' افتراض أن الأسماء في العمود A
derLigne = feuille.Cells(feuille.Rows.Count, "A").End(xlUp).Row
trouve = False
For ligne = 2 To derLigne ' نفترض أن الصف 1 فيه العناوين
If Trim(feuille.Cells(ligne, 1).Value) <> nomUtilisateur Then
feuille.Rows(ligne).Hidden = True
Else
trouve = True
End If
Next ligne
If Not trouve Then
MsgBox "لا توجد مهام مخصصة لهذا المستخدم.", vbExclamation
Else
MsgBox "مرحبًا " & nomUtilisateur & "، تم عرض المهام الخاصة بك.", vbInformation
End If
End SubPrivate Sub Workbook_Open()
Call بدء_النظام
End Sub