{"text_format":"1","workbook":"xlsx","n_sheets":6,"sheets":["Intro","Employees","Filter","Source","Deleted Items","Sheet1"],"not_rendered":{"charts":0,"images":0,"macros":1,"external_links":0,"defined_names":3,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"Intro","index":0,"n_rows":138,"n_cols":1,"rows_kept":138,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
["مقدمة عامة:"]
[]
["يبدو أن هذه الأكواد مكتوبة بلغة VBA (Visual Basic for Applications) وتستخدم في بيئة Microsoft Excel. الهدف الرئيسي منها هو إدارة بيانات الموظفين من خلال نموذج مستخدم (UserForm) يسمى UsrFrm. يتضمن النموذج عناصر تحكم مثل مربعات النصوص (txtName، txtPhoneNumber، txtSalary، TextBox1، txtSelectedValue)، أزرار الخيارات (optMale، optFemale)، صناديق التحرير والسرد (cmbJobStatus، cmbColumnData، cmbHeader)، قائمة (ListBox)، تسميات (ImagePath، Folder، T_resultat)، أزرار الأوامر (btnAdd، btnClear، btnDelete، Supprimer، btnEdit، btnSearch، btnShowData، Folder، UploadImage)، وأزرار للتحكم في القائمة (LS1، LS2، SpinButton2)."]
[]
["يتم تخزين بيانات الموظفين في ورقة عمل تسمى \"Employees\"، وقد تكون هناك ورقة عمل أخرى تسمى \"Deleted Items\" لتخزين الموظفين المحذوفين، وورقة عمل \"Filter\" لتسهيل عمليات البحث والتصفية. هناك جدول مُعرّف باسم \"Tbl\" في ورقة \"Employees\"."]
[]
["الآن، لننتقل إلى شرح كل إجراء فرعي (Sub) على حدة:"]
[]
["1. Private Sub btnAdd_Click()"]
[]
["الغرض: إضافة موظف جديد إلى ورقة العمل \"Employees\" وتحديث القائمة (ListBox)."]
["التفاصيل:"]
["Dim lastRow As Long: تعريف متغير لتخزين رقم آخر صف به بيانات."]
["UsrFrm.ListBox.RowSource = \"\": ملاحظة: هذا السطر غير ضروري هنا لأنه سيتم تحديث RowSource لاحقًا. كان من الممكن استخدامه لمسح مصدر البيانات مؤقتًا، لكنه لن يؤثر على الوظيفة النهائية هنا."]
["lastRow = WorksheetFunction.CountA(Sheets(\"Employees\").Range(\"A:A\")): استخدام دالة CountA في Excel لحساب عدد الخلايا غير الفارغة في العمود A من ورقة \"Employees\". هذا يحدد آخر صف يحتوي على بيانات."]
["التحقق من ملء الحقول: يتحقق هذا الشرط (If) من أن جميع الحقول المطلوبة في النموذج قد تم ملؤها (الاسم، الجنس، الحالة الوظيفية، رقم الهاتف، بيانات العمود المحدد، الراتب). إذا كان أي من هذه الحقول فارغًا أو لم يتم تحديد الجنس، يتم عرض رسالة خطأ (MsgBox) ويتم إنهاء الإجراء (Exit Sub)."]
["With Sheets(\"Employees\").Cells(lastRow + 1, 2): يبدأ هذا الجزء في التعامل مع أول خلية فارغة أسفل آخر صف به بيانات (العمود B، حيث يفترض أن يبدأ تخزين بيانات الموظفين)."]
[".Value = UsrFrm.txtName.Value: كتابة قيمة مربع نص الاسم في الخلية الحالية."]
[".Offset(0, 1).Value = IIf(UsrFrm.optMale, \"Male\", \"Female\"): كتابة الجنس (\"Male\" أو \"Female\") في العمود التالي بناءً على زر الاختيار المحدد. IIf هي دالة VBA تعمل كدالة IF في Excel."]
["بالمثل، يتم كتابة قيم الحالة الوظيفية، رقم الهاتف، بيانات العمود المحدد، الراتب، ومسار الصورة في الأعمدة التالية باستخدام .Offset."]
["With UsrFrm: يبدأ هذا الجزء في إعادة تعيين قيم عناصر التحكم في النموذج بعد إضافة الموظف. يتم مسح مربعات النصوص، إلغاء تحديد أزرار الاختيار، ومسح صناديق التحرير والسرد وتسمية مسار الصورة والصورة المعروضة."]
["UsrFrm.ListBox.RowSource = \"Employees!Tbl\": هذا السطر يقوم بتحديث مصدر بيانات القائمة (ListBox). يفترض أن هناك جدولًا مُعرّفًا باسم \"Tbl\" في ورقة \"Employees\" يحتوي على نطاق البيانات الذي سيتم عرضه في القائمة."]
[]
["2. Private Sub btnClear_Click()"]
[]
["الغرض: مسح قيم جميع حقول الإدخال في النموذج وإعادة تهيئته لحالة الإضافة."]
["التفاصيل:"]
["With UsrFrm: يبدأ هذا الجزء في التعامل مع عناصر التحكم في النموذج."]
["يتم مسح قيم مربعات النصوص (txtName، txtPhoneNumber، txtSalary، cmbColumnData)."]
["يتم إلغاء تحديد أزرار الاختيار (optMale، optFemale)."]
["يتم مسح قيمة صندوق التحرير والسرد (cmbJobStatus)."]
["يتم مسح تسمية مسار الصورة (ImagePath) والصورة المعروضة (Image)."]
[".btnEdit.Visible = False: إخفاء زر التعديل، حيث لا يوجد موظف محدد للتعديل عند المسح."]
[".btnDelete.Enabled = False: تعطيل زر الحذف لنفس السبب."]
[".btnClear.Caption = \"Clear\": إعادة تسمية زر \"Clear\" إلى \"Clear\" (قد يكون قد تغير إلى \"Return\" عند تحديد موظف)."]
[".ListBox.ListIndex = -1: إلغاء تحديد أي عنصر محدد في القائمة."]
[".ListBox.RowSource = \"Tbl\": إعادة تعيين مصدر بيانات القائمة إلى جدول \"Tbl\" لعرض جميع الموظفين."]
[]
["3. Private Sub btnDelete_Click()"]
[]
["الغرض: حذف الموظف المحدد من القائمة وورقة العمل \"Employees\"."]
["التفاصيل:"]
["Dim usrIndex As Long: تعريف متغير لتخزين فهرس العنصر المحدد في القائمة."]
["Dim rowNum As Long: تعريف متغير لتخزين رقم الصف في ورقة العمل."]
["Dim answer As VbMsgBoxResult: تعريف متغير لتخزين نتيجة مربع رسالة التأكيد."]
["usrIndex = UsrFrm.ListBox.ListIndex: الحصول على فهرس العنصر المحدد في القائمة. إذا لم يتم تحديد أي عنصر، سيكون usrIndex هو -1."]
["If usrIndex = -1 Then: التحقق مما إذا تم تحديد موظف. إذا لم يكن كذلك، يتم عرض رسالة خطأ ويتم إنهاء الإجراء."]
["rowNum = CLng(UsrFrm.ListBox.List(usrIndex, 0)) + 1: مهم: يفترض هذا السطر أن العمود الأول في القائمة (ListBox.List(usrIndex, 0)) يحتوي على رقم الصف الفعلي للموظف في ورقة العمل (أو معرف فريد). يتم تحويل هذه القيمة إلى رقم طويل باستخدام CLng وإضافة 1 لأن فهرس القائمة يبدأ من 0 بينما أرقام صفوف Excel تبدأ من 1."]
["answer = MsgBox(\"Are you sure you want to delete?\", vbYesNo + vbCritical): عرض مربع رسالة تأكيد للمستخدم قبل الحذف."]
["If answer = vbYes Then: إذا ضغط المستخدم على \"Yes\":"]
["Sheets(\"Employees\").Rows(rowNum).EntireRow.Delete: حذف الصف بأكمله الذي يمثل الموظف من ورقة \"Employees\" بناءً على rowNum."]
["Call btnClear_Click: استدعاء الإجراء btnClear_Click لمسح حقول النموذج وإعادة تهيئته."]
[]
["4. Private Sub Supprimer_Click()"]
[]
["الغرض: يبدو أن هذا الإجراء له وظيفة مشابهة لـ btnDelete_Click ولكنه قد يكون مصممًا للعمل بشكل مختلف قليلاً أو مرتبطًا بعناصر تحكم مختلفة في النموذج."]
["التفاصيل:"]
["If Me.TextBox1 = Empty Then Exit Sub: الخروج من الإجراء إذا كان TextBox1 فارغًا. قد يشير هذا إلى أن هذا الإجراء يعتمد على قيمة في TextBox1 لتحديد الموظف المراد حذفه."]
["If Not IsEmpty(Me.N_ligne) Then: التحقق من أن Me.N_ligne (قد يكون مربع نص آخر) ليس فارغًا."]
["If MsgBox(\"Are you sure you want to delete \" & Me.TextBox5 & \"?\", vbYesNo + vbQuestion + vbDefaultButton2, \"Confirm Delete\") = vbYes Then: عرض مربع رسالة تأكيد يتضمن اسم الموظف (مأخوذ من Me.TextBox5)."]
["Dim wsData As Worksheet, Dim wsDeleted As Worksheet, إلخ.: تعريف متغيرات لكائنات ورقة العمل \"Employees\" و \"Deleted Items\" ومتغيرات أخرى للتعامل مع الصفوف."]
["Set wsData = ThisWorkbook.Sheets(\"Employees\"): تعيين كائن ورقة العمل \"Employees\"."]
["Set wsDeleted = ThisWorkbook.Sheets(\"Deleted Items\"): تعيين كائن ورقة العمل \"Deleted Items\"."]
["Set deletedRow = wsData.Rows(CLng(Me.N_ligne)): تحديد الصف المراد حذفه في ورقة \"Employees\" بناءً على القيمة الموجودة في Me.N_ligne."]
["lastRowDeleted = wsDeleted.Cells(Rows.Count, 1).End(xlUp).Row + 1: تحديد أول صف فارغ في ورقة \"Deleted Items\"."]
["deletedRow.Copy Destination:=wsDeleted.Rows(lastRowDeleted): نسخ الصف المحذوف إلى ورقة \"Deleted Items\"."]
["deletedRow.Delete Shift:=xlUp: حذف الصف من ورقة \"Employees\" مع إزاحة الصفوف الأخرى للأعلى."]
["Me.N_ligne = \"\": مسح قيمة Me.N_ligne."]
["Call effacer: استدعاء إجراء فرعي آخر يسمى effacer (يفترض أنه يقوم بتنظيف حقول النموذج - قد يكون هذا مشابهًا لـ btnClear_Click)."]
["Call UserForm_Initialize: استدعاء الإجراء UserForm_Initialize لإعادة تهيئة النموذج (قد يشمل تحديث القائمة)."]
["Call ResetSequence: استدعاء الإجراء ResetSequence لإعادة ترقيم تسلسل الموظفين في ورقة \"Employees\"."]
[]
["5. Sub ResetSequence()"]
[]
["الغرض: إعادة ترقيم الموظفين في العمود الأول من ورقة \"Employees\" بتنسيق \"0000\"."]
["التفاصيل:"]
["Dim ws As Worksheet: تعريف متغير لكائن ورقة العمل."]
["Set ws = ThisWorkbook.Sheets(\"Employees\"): تعيين كائن ورقة العمل \"Employees\"."]
["lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row: تحديد آخر صف به بيانات في العمود الأول."]
["sequenceNumber = 1: تهيئة رقم التسلسل."]
["For i = 2 To lastRow: التكرار خلال الصفوف التي تحتوي على بيانات، بدءًا من الصف الثاني (بافتراض أن الصف الأول يحتوي على الرؤوس)."]
["ws.Cells(i, 1).Value = Format(sequenceNumber, \"0000\"): كتابة رقم التسلسل الحالي في العمود الأول بتنسيق أربعة أرقام (مثل \"0001\"، \"0010\")."]
["sequenceNumber = sequenceNumber + 1: زيادة رقم التسلسل."]
[]
["6. Private Sub btnEdit_Click()"]
[]
["الغرض: تعديل بيانات الموظف المحدد في القائمة وتحديث ورقة العمل \"Employees\"."]
["التفاصيل:"]
["usrIndex = Me.ListBox.ListIndex: الحصول على فهرس العنصر المحدد في القائمة."]
["If usrIndex = -1 Then: التحقق من تحديد موظف."]
["rowNum = CLng(Me.ListBox.List(usrIndex, 0)) + 1: الحصول على رقم الصف من العمود الأول في القائمة."]
["Me.ListBox.ListIndex = -1: إلغاء تحديد العنصر في القائمة مؤقتًا."]
["التحقق من ملء الحقول: يتم إجراء نفس التحقق كما في btnAdd_Click للتأكد من ملء جميع الحقول المطلوبة قبل التعديل."]
["With Sheets(\"Employees\").Cells(rowNum, 2): التعامل مع الصف المحدد في ورقة \"Employees\" (بناءً على rowNum)."]
["يتم تحديث قيم الخلايا في الأعمدة المقابلة بقيم عناصر التحكم في النموذج (txtName، optMale/optFemale، cmbJobStatus، txtPhoneNumber، cmbColumnData، txtSalary، ImagePath.Caption)."]
["Sheets(\"Employees\").Range(\"Tbl[#All]\").AdvancedFilter ...: هذا الجزء يقوم بإعادة تطبيق التصفية المتقدمة على جدول \"Tbl\" باستخدام المعايير الموجودة في ورقة \"Filter\". قد يكون هذا ضروريًا لتحديث عرض البيانات في القائمة إذا كانت هناك تصفية نشطة."]
["Me.ListBox.ListIndex = usrIndex: إعادة تحديد العنصر الذي تم تعديله في القائمة."]
[]
["7. Private Sub btnSearch_Click()"]
[]
["الغرض: البحث عن موظفين بناءً على المعايير المدخلة في النموذج وعرض النتائج في القائمة."]
["التفاصيل:"]
["Dim cntRows As Long: تعريف متغير لتخزين عدد الصفوف التي تم العثور عليها."]
["With Sheets(\"Filter\"): التعامل مع ورقة العمل \"Filter\"."]
["يتم كتابة قيم حقول النموذج (txtName، الجنس، cmbJobStatus، txtPhoneNumber، cmbColumnData، txtSalary) في الصف الثاني من الأعمدة K إلى P في ورقة \"Filter\". يفترض أن الصف الأول في هذه الأعمدة يحتوي على رؤوس تطابق رؤوس الأعمدة في بيانات الموظفين."]
["Sheets(\"Employees\").Range(\"Tbl[#All]\").AdvancedFilter ...: يتم تطبيق التصفية المتقدمة على جدول \"Tbl\" في ورقة \"Employees\". يتم استخدام النطاق K1:P2 في ورقة \"Filter\" كمعايير التصفية، ويتم نسخ النتائج إلى النطاق A1:H1 في نفس الورقة."]
["cntRows = Application.WorksheetFunction.CountA(Sheets(\"Filter\").Range(\"A:A\")): حساب عدد الصفوف التي تم العثور عليها في ورقة \"Filter\" (العمود A)."]
["If cntRows <= 1 Then: إذا كان عدد الصفوف 1 أو أقل (بما في ذلك صف الرأس)، فهذا يعني عدم العثور على نتائج. يتم عرض رسالة \"Not Found!\" ويتم إعادة تعيين مصدر بيانات القائمة لعرض جميع البيانات من جدول \"Tbl\"."]
["Else: إذا تم العثور على نتائج، يتم تعيين مصدر بيانات القائمة إلى النطاق A2:H في ورقة \"Filter\" (بدءًا من الصف الثاني لتجنب الرؤوس) وحتى آخر صف تم العثور عليه (cntRows)."]
[]
["8. Private Sub btnShowData_Click()"]
[]
["الغرض: إظهار ورقة العمل \"Employees\" (قد تكون مخفية) بعد إدخال كلمة مرور صحيحة."]
["التفاصيل:"]
["Dim password As Variant: تعريف متغير لتخزين كلمة المرور المدخلة."]
["password = InputBox(\"Please enter the password\"): عرض مربع إدخال للمستخدم لإدخال كلمة المرور."]
["If CStr(password) = \"1234\" Then: التحقق من أن كلمة المرور المدخلة هي \"1234\" (يجب استخدام طريقة أكثر أمانًا لتخزين ومقارنة كلمات المرور في تطبيقات حقيقية)."]
["Application.Visible = True: جعل تطبيق Excel مرئيًا (إذا كان مخفيًا)."]
["With Sheets(\"Employees\"): التعامل مع ورقة العمل \"Employees\"."]
[".Visible = True: جعل ورقة \"Employees\" مرئية."]
[".Activate: تنشيط ورقة \"Employees\"."]
["UsrFrm.Hide: إخفاء نموذج المستخدم."]
["Else: إذا كانت كلمة المرور غير صحيحة، يتم عرض رسالة خطأ."]
[]
["9. Private Sub Folder_Click()"]
[]
["الغرض: السماح للمستخدم بتحديد مجلد وتحديث مسارات الصور المخزنة في عمود \"Image\" لجدول \"Tbl\"."]
["التفاصيل:"]
["Dim fileDialog As FileDialog: تعريف متغير لكائن FileDialog (مربع حوار الملفات)."]
["Set fileDialog = Application.FileDialog(msoFileDialogFolderPicker): إنشاء مربع حوار لاختيار مجلد."]
["fileDialog.Title = \"Select Destination Folder\": تعيين عنوان مربع الحوار."]
["fileDialog.AllowMultiSelect = False: السماح باختيار مجلد واحد فقط."]
["If fileDialog.Show = 0 Then Exit Sub: الخروج من الإجراء إذا قام المستخدم بإلغاء مربع الحوار."]
["selectedFolder = fileDialog.SelectedItems(1): الحصول على المسار المحدد للمجلد."]
["Sheets(\"Employees\").Range(\"Tbl[Image]\").Replace UsrFrm.Folder.Caption, selectedFolder: استبدال النص الموجود في تسمية UsrFrm.Folder.Caption (يفترض أنه يحتوي على مسار المجلد القديم) بالمسار الجديد المحدد (selectedFolder)"]

{"sheet":"Employees","index":1,"n_rows":180,"n_cols":11,"rows_kept":180,"cut":false,"hidden":true,"merged":[]}
["مسلسل","كود البصمة","Gender","الرتبة","مكان العمل","الرقم الوطني","الإسم بالكامل","ملاحظات","مسار الصورة","توقيت تعديل البيانات","اسم المستخدم"]
[1,1,"Male","مهندس","طرابلس",11589960,"محمد علي صالح","لا يوجد","C:\\Users\\WiN_11\\Pictures\\WhatsApp Image 2025-03-12 at 5.43.27 AM.jpg","لا يوجد","لا يوجد"]
[2,2,"Male","موظف","غريان",4879566,"إبراهيم علي محمد","لا يوجد"]
[3,3,"Male","رئيس قسم","بنغازي",14551200,"علي خالد","لا يوجد"]
[5,4,"Female","رئيس قسم","طرابلس",2670936,"موظف1","لا يوجد"]
[8,5,"Female","مهندس","سرت",4853466,"موظف5","لا يوجد"]
[9,6,"Female","موظف","طرابلس",5580976,"موظف6","لا يوجد"]
[10,7,"Male","رئيس قسم","غريان",6308486,"موظف7","لا يوجد"]
[11,8,"Male","مهندس","بنغازي",7035996,"موظف8","لا يوجد"]
[12,9,"Male","موظف","البريقة",7763506,"موظف9","لا يوجد"]
[13,10,null,"رئيس قسم","سرت",8491016,"موظف10","لا يوجد"]
[14,11,null,"مهندس","طرابلس",9218526,"موظف11","لا يوجد"]
[15,12,null,"موظف","غريان",9946036,"موظف12","لا يوجد"]
[16,13,null,"رئيس قسم","بنغازي",10673546,"موظف13","لا يوجد"]
[17,14,null,"مهندس","البريقة",11401056,"موظف14","لا يوجد"]
[18,15,null,"موظف","سرت",12128566,"موظف15","لا يوجد"]
[19,16,null,"رئيس قسم","طرابلس",12856076,"موظف16","لا يوجد"]
[20,17,null,"مهندس","غريان",13583586,"موظف17","لا يوجد"]
[21,18,null,"موظف","بنغازي",14311096,"موظف18","لا يوجد"]
[22,19,null,"رئيس قسم","البريقة",15038606,"موظف19","لا يوجد"]
[23,20,null,"مهندس","سرت",15766116,"موظف20","لا يوجد"]
[24,21,null,"موظف","طرابلس",16493626,"موظف21","لا يوجد"]
[25,22,null,"رئيس قسم","غريان",17221136,"موظف22","لا يوجد"]
[26,23,null,"مهندس","بنغازي",17948646,"موظف23","لا يوجد"]
[27,24,null,"موظف","البريقة",18676156,"موظف24","لا يوجد"]
[28,25,null,"رئيس قسم","سرت",19403666,"موظف25","لا يوجد"]
[29,26,null,"مهندس","طرابلس",20131176,"موظف26","لا يوجد"]
[30,27,null,"موظف","غريان",20858686,"موظف27","لا يوجد"]
[31,28,null,"رئيس قسم","بنغازي",21586196,"موظف28","لا يوجد"]
[32,29,null,"مهندس","البريقة",22313706,"موظف29","لا يوجد"]
[33,30,null,"موظف","سرت",23041216,"موظف30","لا يوجد"]
[34,31,null,"رئيس قسم","طرابلس",23768726,"موظف31","لا يوجد"]
[35,32,null,"مهندس","غريان",24496236,"موظف32","لا يوجد"]
[36,33,null,"موظف","بنغازي",25223746,"موظف33","لا يوجد"]
[37,34,null,"رئيس قسم","البريقة",25951256,"موظف34","لا يوجد"]
[38,35,null,"مهندس","سرت",26678766,"موظف35","لا يوجد"]
[39,36,null,"موظف","طرابلس",27406276,"موظف36","لا يوجد"]
[40,37,null,"رئيس قسم","غريان",28133786,"موظف37","لا يوجد"]
[41,38,null,"مهندس","بنغازي",28861296,"موظف38","لا يوجد"]
[42,39,null,"موظف","البريقة",29588806,"موظف39","لا يوجد"]
[43,40,null,"رئيس قسم","سرت",30316316,"موظف40","لا يوجد"]
[44,41,null,"مهندس","طرابلس",31043826,"موظف41","لا يوجد"]
[45,42,null,"موظف","غريان",31771336,"موظف42","لا يوجد"]
[46,43,null,"رئيس قسم","بنغازي",32498846,"موظف43","لا يوجد"]
[47,44,null,"مهندس","البريقة",33226356,"موظف44","لا يوجد"]
[48,45,null,"موظف","سرت",33953866,"موظف45","لا يوجد"]
[49,46,null,"رئيس قسم","طرابلس",34681376,"موظف46","لا يوجد"]
[50,47,null,"مهندس","غريان",35408886,"موظف47","لا يوجد"]
[51,48,null,"موظف","بنغازي",36136396,"موظف48","لا يوجد"]
[52,49,null,"رئيس قسم","البريقة",36863906,"موظف49","لا يوجد"]
[53,50,null,"مهندس","سرت",37591416,"موظف50","لا يوجد"]
[54,51,null,"موظف","طرابلس",38318926,"موظف51","لا يوجد"]
[55,52,null,"رئيس قسم","غريان",38318927,"موظف52","لا يوجد"]
[56,53,null,"مهندس","بنغازي",38318928,"موظف53","لا يوجد"]
[57,54,null,"موظف","البريقة",38318929,"موظف54","لا يوجد"]
[58,55,null,"رئيس قسم","سرت",38318930,"موظف55","لا يوجد"]
[59,56,null,"مهندس","طرابلس",38318931,"موظف56","لا يوجد"]
[60,57,null,"موظف","غريان",38318932,"موظف57","لا يوجد"]
[61,58,null,"رئيس قسم","بنغازي",38318933,"موظف58","لا يوجد"]
[62,59,null,"مهندس","البريقة",38318934,"موظف59","لا يوجد"]
[63,60,null,"موظف","سرت",38318935,"موظف60","لا يوجد"]
[64,61,null,"رئيس قسم","طرابلس",38318936,"موظف61","لا يوجد"]
[65,62,null,"مهندس","غريان",38318937,"موظف62","لا يوجد"]
[66,63,null,"موظف","بنغازي",38318938,"موظف63","لا يوجد"]
[67,64,null,"رئيس قسم","البريقة",38318939,"موظف64","لا يوجد"]
[68,65,null,"مهندس","سرت",38318940,"موظف65","لا يوجد"]
[69,66,null,"موظف","طرابلس",38318941,"موظف66","لا يوجد"]
[70,67,null,"رئيس قسم","غريان",38318942,"موظف67","لا يوجد"]
[71,68,null,"مهندس","بنغازي",38318943,"موظف68","لا يوجد"]
[72,69,null,"موظف","البريقة",38318944,"موظف69","لا يوجد"]
[73,70,null,"رئيس قسم","سرت",38318945,"موظف70","لا يوجد"]
[74,71,null,"مهندس","طرابلس",38318946,"موظف71","لا يوجد"]
[75,72,null,"موظف","غريان",38318947,"موظف72","لا يوجد"]
[76,73,null,"رئيس قسم","بنغازي",38318948,"موظف73","لا يوجد"]
[77,74,null,"مهندس","البريقة",38318949,"موظف74","لا يوجد"]
[78,75,null,"موظف","سرت",38318950,"موظف75","لا يوجد"]
[79,76,null,"رئيس قسم","طرابلس",38318951,"موظف76","لا يوجد"]
[80,77,null,"مهندس","غريان",38318952,"موظف77","لا يوجد"]
[81,78,null,"موظف","بنغازي",38318953,"موظف78","لا يوجد"]
[82,79,null,"رئيس قسم","البريقة",38318954,"موظف79","لا يوجد"]
[83,80,null,"مهندس","سرت",38318955,"موظف80","لا يوجد"]
[84,81,null,"موظف","طرابلس",38318956,"موظف81","لا يوجد"]
[85,82,null,"رئيس قسم","غريان",38318957,"موظف82","لا يوجد"]
[86,83,null,"مهندس","بنغازي",38318958,"موظف83","لا يوجد"]
[87,84,null,"موظف","البريقة",38318959,"موظف84","لا يوجد"]
[88,85,null,"رئيس قسم","سرت",38318960,"موظف85","لا يوجد"]
[89,86,null,"مهندس","طرابلس",38318961,"موظف86","لا يوجد"]
[90,87,null,"موظف","غريان",38318962,"موظف87","لا يوجد"]
[91,88,null,"رئيس قسم","بنغازي",38318963,"موظف88","لا يوجد"]
[92,89,null,"مهندس","البريقة",38318964,"موظف89","لا يوجد"]
[93,90,null,"موظف","سرت",38318965,"موظف90","لا يوجد"]
[94,91,null,"رئيس قسم","طرابلس",38318966,"موظف91","لا يوجد"]
[95,92,null,"مهندس","غريان",38318967,"موظف92","لا يوجد"]
[96,93,null,"موظف","بنغازي",38318968,"موظف93","لا يوجد"]
[97,94,null,"رئيس قسم","البريقة",38318969,"موظف94","لا يوجد"]
[98,95,null,"مهندس","سرت",38318970,"موظف95","لا يوجد"]
[99,96,null,"موظف","طرابلس",38318971,"موظف96","لا يوجد"]
[100,97,null,"رئيس قسم","غريان",38318972,"موظف97","لا يوجد"]
[101,98,null,"مهندس","بنغازي",38318973,"موظف98","لا يوجد"]
[102,99,null,"موظف","البريقة",38318974,"موظف99","لا يوجد"]
[103,100,null,"رئيس قسم","سرت",38318975,"موظف100","لا يوجد"]
[104,101,null,"مهندس","طرابلس",38318976,"موظف101","لا يوجد"]
[105,102,null,"موظف","غريان",38318977,"موظف102","لا يوجد"]
[106,103,null,"رئيس قسم","بنغازي",38318978,"موظف103","لا يوجد"]
[107,104,null,"مهندس","البريقة",38318979,"موظف104","لا يوجد"]
[108,105,null,"موظف","سرت",38318980,"موظف105","لا يوجد"]
[109,106,null,"رئيس قسم","طرابلس",38318981,"موظف106","لا يوجد"]
[110,107,null,"مهندس","غريان",38318982,"موظف107","لا يوجد"]
[111,108,null,"موظف","بنغازي",38318983,"موظف108","لا يوجد"]
[112,109,null,"رئيس قسم","البريقة",38318984,"موظف109","لا يوجد"]
[113,110,null,"مهندس","سرت",38318985,"موظف110","لا يوجد"]
[114,111,null,"موظف","طرابلس",38318986,"موظف111","لا يوجد"]
[115,112,null,"رئيس قسم","غريان",38318987,"موظف112","لا يوجد"]
[116,113,null,"مهندس","بنغازي",38318988,"موظف113","لا يوجد"]
[117,114,null,"موظف","البريقة",38318989,"موظف114","لا يوجد"]
[118,115,null,"رئيس قسم","سرت",38318990,"موظف115","لا يوجد"]
[119,116,null,"مهندس","طرابلس",38318991,"موظف116","لا يوجد"]
[120,117,null,"موظف","غريان",38318992,"موظف117","لا يوجد"]
[121,118,null,"رئيس قسم","بنغازي",38318993,"موظف118","لا يوجد"]
[122,119,null,"مهندس","البريقة",38318994,"موظف119","لا يوجد"]
[123,120,null,"موظف","سرت",38318995,"موظف120","لا يوجد"]
[124,121,null,"رئيس قسم","طرابلس",38318996,"موظف121","لا يوجد"]
[125,122,null,"مهندس","غريان",38318997,"موظف122","لا يوجد"]
[126,123,null,"موظف","بنغازي",38318998,"موظف123","لا يوجد"]
[127,124,null,"رئيس قسم","البريقة",38318999,"موظف124","لا يوجد"]
[128,125,null,"مهندس","سرت",38319000,"موظف125","لا يوجد"]
[129,126,null,"موظف","طرابلس",38319001,"موظف126","لا يوجد"]
[130,127,null,"رئيس قسم","غريان",38319002,"موظف127","لا يوجد"]
[131,128,null,"مهندس","بنغازي",38319003,"موظف128","لا يوجد"]
[132,129,null,"موظف","البريقة",38319004,"موظف129","لا يوجد"]
[133,130,null,"رئيس قسم","سرت",38319005,"موظف130","لا يوجد"]
[134,131,null,"مهندس","طرابلس",38319006,"موظف131","لا يوجد"]
[135,132,null,"موظف","غريان",38319007,"موظف132","لا يوجد"]
[136,133,null,"رئيس قسم","بنغازي",38319008,"موظف133","لا يوجد"]
[137,134,null,"مهندس","البريقة",38319009,"موظف134","لا يوجد"]
[138,135,null,"موظف","سرت",38319010,"موظف135","لا يوجد"]
[139,136,null,"رئيس قسم","طرابلس",38319011,"موظف136","لا يوجد"]
[140,137,null,"مهندس","غريان",38319012,"موظف137","لا يوجد"]
[141,138,null,"موظف","بنغازي",38319013,"موظف138","لا يوجد"]
[142,139,null,"رئيس قسم","البريقة",38319014,"موظف139","لا يوجد"]
[143,140,null,"مهندس","سرت",38319015,"موظف140","لا يوجد"]
[144,141,null,"موظف","طرابلس",38319016,"موظف141","لا يوجد"]
[145,142,null,"رئيس قسم","غريان",38319017,"موظف142","لا يوجد"]
[146,143,null,"مهندس","بنغازي",38319018,"موظف143","لا يوجد"]
[147,144,null,"موظف","البريقة",38319019,"موظف144","لا يوجد"]
[148,145,null,"رئيس قسم","سرت",38319020,"موظف145","لا يوجد"]
[149,146,null,"مهندس","طرابلس",38319021,"موظف146","لا يوجد"]
[150,147,null,"موظف","غريان",38319022,"موظف147","لا يوجد"]
[151,148,null,"رئيس قسم","بنغازي",38319023,"موظف148","لا يوجد"]
[152,149,null,"مهندس","البريقة",38319024,"موظف149","لا يوجد"]
[153,150,null,"موظف","سرت",38319025,"موظف150","لا يوجد"]
[154,151,null,"رئيس قسم","طرابلس",38319026,"موظف151","لا يوجد"]
[155,152,null,"مهندس","غريان",38319027,"موظف152","لا يوجد"]
[156,153,null,"موظف","بنغازي",38319028,"موظف153","لا يوجد"]
[157,154,null,"رئيس قسم","البريقة",38319029,"موظف154","لا يوجد"]
[158,155,null,"مهندس","سرت",38319030,"موظف155","لا يوجد"]
[159,156,null,"موظف","طرابلس",38319031,"موظف156","لا يوجد"]
[160,157,null,"رئيس قسم","غريان",38319032,"موظف157","لا يوجد"]
[161,158,null,"مهندس","بنغازي",38319033,"موظف158","لا يوجد"]
[162,159,null,"موظف","البريقة",38319034,"موظف159","لا يوجد"]
[163,160,null,"رئيس قسم","سرت",38319035,"موظف160","لا يوجد"]
[164,161,null,"مهندس","طرابلس",56239874,"موظف161","لا يوجد"]
[165,162,null,"موظف","غريان",56239875,"موظف162","لا يوجد"]
[166,163,null,"رئيس قسم","بنغازي",56239876,"موظف163","لا يوجد"]
[167,164,null,"مهندس","البريقة",56239877,"موظف164","لا يوجد"]
[168,165,null,"موظف","سرت",56239878,"موظف165","لا يوجد"]
[169,166,null,"رئيس قسم","طرابلس",56239878,"موظف166","لا يوجد"]
[170,167,null,"مهندس","غريان",56239880,"موظف167","لا يوجد"]
[171,168,null,"موظف","بنغازي",56239881,"موظف168","لا يوجد"]
[172,169,null,"رئيس قسم","البريقة",56239882,"موظف169","لا يوجد"]
[173,170,null,"مهندس","سرت",56239883,"موظف170","لا يوجد"]
[174,171,null,"موظف","طرابلس",56239884,"موظف171","لا يوجد"]
[175,172,null,"رئيس قسم","غريان",56239885,"موظف172","لا يوجد"]
[176,173,null,"مهندس","بنغازي",56239886,"موظف173","لا يوجد"]
[177,174,null,"مهندس","طرابلس",56239887,"محمد علي صالح","لا يوجد"]
[178,175,null,"موظف","غريان",56239888,"إبراهيم علي محمد","لا يوجد"]
[179,176,null,"رئيس قسم","غريان",88756664,"موظف7","لا يوجد"]
[180,177,null,"مهندس","طرابلس",75698422,"محمد علي صالح","لا يوجد"]
[181,178,null,"رئيس قسم","بنغازي",26479654,"علي خالد","لا يوجد"]
[182,179,null,"رئيس قسم","البريقة",44563695,"موظف4","لا يوجد"]

{"sheet":"Filter","index":2,"n_rows":2,"n_cols":16,"rows_kept":2,"cut":false,"hidden":true,"merged":[]}
["No","Name","Gender","Job Status","Phone Number","Job Rate","Salary","Image",null,null,"Name","Gender","Job Status","Phone Number","Job Rate","Salary"]
[null,null,null,null,null,null,null,null,null,null,null,"Female",null,null,1]

{"sheet":"Source","index":3,"n_rows":5,"n_cols":3,"rows_kept":5,"cut":false,"hidden":true,"merged":[]}
["Full Time",null,1]
["Part Time",null,2]
["Contract",null,3]
["Hourly",null,4]
[null,null,5]

{"sheet":"Deleted Items","index":4,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":false,"merged":[]}

{"sheet":"Sheet1","index":5,"n_rows":501,"n_cols":5,"rows_kept":501,"cut":false,"hidden":false,"merged":[]}
[]
[null,null,null,null,"Private Sub btnAdd_Click()"]
[null,null,null,null,"Dim lastRow As Long"]
[]
[null,null,null,null,"UsrFrm.ListBox.RowSource = \"\""]
[null,null,null,null,"lastRow = WorksheetFunction.CountA(Sheets(\"Employees\").Range(\"A:A\"))"]
[null,null,null,null,"If UsrFrm.txtName.Value = \"\" Or (UsrFrm.optMale = False And UsrFrm.optFemale = False) Or UsrFrm.cmbJobStatus.Value = \"\" Or UsrFrm.txtPhoneNumber.Value = \"\" Or UsrFrm.cmbColumnData.Value = \"\" Or UsrFrm.txtSalary.Value = \"\" Then"]
[null,null,null,null,"MsgBox \"Please fill all information\""]
[null,null,null,null,"Else"]
[]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 2).Value = UsrFrm.txtName.Value"]
[]
[null,null,null,null,"If UsrFrm.optMale = True Then"]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 3).Value = \"Male\""]
[null,null,null,null,"Else"]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 3).Value = \"Female\""]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 4).Value = UsrFrm.cmbJobStatus.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 5).Value = UsrFrm.txtPhoneNumber.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 6).Value = UsrFrm.cmbColumnData.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 7).Value = UsrFrm.txtSalary.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(lastRow + 1, 8).Value = UsrFrm.ImagePath.Caption"]
[]
[null,null,null,null,"UsrFrm.txtName.Value = \"\""]
[null,null,null,null,"UsrFrm.optMale = False"]
[null,null,null,null,"UsrFrm.optFemale = False"]
[null,null,null,null,"UsrFrm.cmbJobStatus.Value = \"\""]
[null,null,null,null,"UsrFrm.txtPhoneNumber.Value = \"\""]
[null,null,null,null,"UsrFrm.cmbColumnData.Value = \"\""]
[null,null,null,null,"UsrFrm.txtSalary.Value = \"\""]
[null,null,null,null,"UsrFrm.ImagePath.Caption = \"\""]
[null,null,null,null,"UsrFrm.Image.Picture = LoadPicture(vbNullString)"]
[]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"UsrFrm.ListBox.RowSource = \"Employees!Tbl\""]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub btnClear_Click()"]
[null,null,null,null,"UsrFrm.txtName.Value = \"\""]
[null,null,null,null,"UsrFrm.optMale = False"]
[null,null,null,null,"UsrFrm.optFemale = False"]
[null,null,null,null,"UsrFrm.cmbJobStatus.Value = \"\""]
[null,null,null,null,"UsrFrm.txtPhoneNumber.Value = \"\""]
[null,null,null,null,"UsrFrm.cmbColumnData.Value = \"\""]
[null,null,null,null,"UsrFrm.txtSalary.Value = \"\""]
[null,null,null,null,"UsrFrm.ImagePath.Caption = \"\""]
[null,null,null,null,"UsrFrm.Image.Picture = LoadPicture(vbNullString)"]
[]
[]
[null,null,null,null,"Me.btnEdit.Visible = False"]
[null,null,null,null,"Me.btnDelete.Enabled = False"]
[null,null,null,null,"Me.btnClear.Caption = \"Clear\""]
[null,null,null,null,"Me.ListBox.ListIndex = -1"]
[null,null,null,null,"Me.ListBox.RowSource = \"Tbl\""]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub btnDelete_Click()"]
[null,null,null,null,"Dim UsrIndx As Long"]
[null,null,null,null,"Dim RowNum As Long"]
[null,null,null,null,"Dim Ansr As VbMsgBoxResult"]
[]
[null,null,null,null,"UsrIndx = UsrFrm.ListBox.ListIndex"]
[null,null,null,null,"RowNum = UsrFrm.ListBox.List(UsrIndx, 0) + 1"]
[]
[null,null,null,null,"Ansr = MsgBox(\"Are you sure you want to delete?\", vbYesNo + vbCritical)"]
[]
[null,null,null,null,"If Ansr = vbYes Then"]
[null,null,null,null,"Sheets(\"Employees\").Rows(RowNum).EntireRow.Delete"]
[null,null,null,null,"Call btnClear_Click"]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"End Sub"]
[null,null,null,null,"Private Sub Supprimer_Click() ' ?I?"]
[null,null,null,null,"    If Me.TextBox1 = Empty Then: Exit Sub"]
[null,null,null,null,"    If Me.N_ligne <> \"\" Then"]
[null,null,null,null,"        If MsgBox(\" ?? C?E ?EC?I ?? ??? \" & TextBox5 & \"?\", vbYesNo + vbQuestion + vbDefaultButton2, \"??EEC?\") = vbYes Then"]
[null,null,null,null,"            Dim wsData As Worksheet"]
[null,null,null,null,"            Dim wsDeleted As Worksheet"]
[null,null,null,null,"            Dim deletedRow As Range"]
[null,null,null,null,"            Dim lastRowDeleted As Long"]
[]
[null,null,null,null,"            Set wsData = ThisWorkbook.Sheets(\"Employees\")"]
[null,null,null,null,"            Set wsDeleted = ThisWorkbook.Sheets(\"Deleted Items\")"]
[null,null,null,null,"            Set deletedRow = wsData.Rows(Me.N_ligne)"]
[null,null,null,null,"            lastRowDeleted = wsDeleted.Cells(Rows.Count, 1).End(xlUp).Row + 1"]
[]
[null,null,null,null,"            ' Copy the entire row to \"Deleted Items\""]
[null,null,null,null,"            deletedRow.Copy Destination:=wsDeleted.Rows(lastRowDeleted)"]
[]
[null,null,null,null,"            ' Delete the row from \"DbSheet\""]
[null,null,null,null,"            deletedRow.Delete Shift:=xlUp"]
[]
[null,null,null,null,"            Me.N_ligne = \"\""]
[null,null,null,null,"            effacer"]
[null,null,null,null,"            UserForm_Initialize ' Refresh the ListBox"]
[]
[null,null,null,null,"            ' Reset the sequence numbers"]
[null,null,null,null,"            Call ResetSequence"]
[null,null,null,null,"   ' ... your existing UserForm_Initialize code ..."]
[null,null,null,null,"'    Call series2 ' You might want to adjust when series1 is called"]
[]
[null,null,null,null,"        End If"]
[null,null,null,null,"    End If"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Sub ResetSequence()"]
[null,null,null,null,"    Dim ws As Worksheet"]
[null,null,null,null,"    Dim lastRow As Long"]
[null,null,null,null,"    Dim i As Long"]
[null,null,null,null,"    Dim sequenceNumber As Long"]
[]
[null,null,null,null,"    Set ws = ThisWorkbook.Sheets(\"Employees\")"]
[null,null,null,null,"    lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row"]
[]
[null,null,null,null,"    sequenceNumber = 1"]
[null,null,null,null,"    For i = 2 To lastRow ' Assuming headers in the first row"]
[null,null,null,null,"        ws.Cells(i, 1).Value = Format(sequenceNumber, \"0000\") ' Write the new sequence"]
[null,null,null,null,"        sequenceNumber = sequenceNumber + 1"]
[null,null,null,null,"    Next i"]
[null,null,null,null,"End Sub"]
[]
[]
[null,null,null,null,"Private Sub btnEdit_Click()"]
[null,null,null,null,"Dim RowNum As Long"]
[]
[null,null,null,null,"UsrIndx = Me.ListBox.ListIndex"]
[null,null,null,null,"RowNum = Me.ListBox.List(UsrIndx, 0) + 1"]
[]
[null,null,null,null,"Me.ListBox.ListIndex = -1"]
[]
[null,null,null,null,"If UsrFrm.txtName.Value = \"\" Or (UsrFrm.optMale = False And UsrFrm.optFemale = False) Or UsrFrm.cmbJobStatus.Value = \"\" Or UsrFrm.txtPhoneNumber.Value = \"\" Or UsrFrm.cmbColumnData.Value = \"\" Or UsrFrm.txtSalary.Value = \"\" Then"]
[null,null,null,null,"MsgBox \"Please fill all information\""]
[]
[null,null,null,null,"Else"]
[]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 2).Value = Me.txtName.Value"]
[null,null,null,null,"If Me.optMale = True Then"]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 3).Value = \"Male\""]
[null,null,null,null,"Else"]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 3).Value = \"Female\""]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 5).Value = Me.txtPhoneNumber.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 4).Value = Me.cmbJobStatus.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 6).Value = Me.cmbColumnData.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 7).Value = Me.txtSalary.Value"]
[null,null,null,null,"Sheets(\"Employees\").Cells(RowNum, 8).Value = Me.ImagePath.Caption"]
[]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"    Sheets(\"Employees\").Range(\"Tbl[#All]\").AdvancedFilter Action:=xlFilterCopy, _"]
[null,null,null,null,"        CriteriaRange:=Sheets(\"Filter\").Range(\"K1:P2\"), CopyToRange:=Sheets(\"Filter\").Range(\"A1:H1\"), Unique:=False"]
[null,null,null,null,"Me.ListBox.ListIndex = UsrIndx"]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub btnSearch_Click()"]
[null,null,null,null,"Dim CntRows As Long"]
[]
[null,null,null,null,"Sheets(\"Filter\").Range(\"K2\").Value = UsrFrm.txtName.Value"]
[]
[null,null,null,null,"If UsrFrm.optMale = True Then"]
[null,null,null,null,"Sheets(\"Filter\").Range(\"L2\").Value = \"Male\""]
[null,null,null,null,"ElseIf UsrFrm.optFemale = True Then"]
[null,null,null,null,"Sheets(\"Filter\").Range(\"L2\").Value = \"Female\""]
[null,null,null,null,"Else"]
[null,null,null,null,"Sheets(\"Filter\").Range(\"L2\").Value = \"\""]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"Sheets(\"Filter\").Range(\"M2\").Value = UsrFrm.cmbJobStatus.Value"]
[null,null,null,null,"Sheets(\"Filter\").Range(\"N2\").Value = UsrFrm.txtPhoneNumber.Value"]
[null,null,null,null,"Sheets(\"Filter\").Range(\"O2\").Value = UsrFrm.cmbColumnData.Value"]
[null,null,null,null,"Sheets(\"Filter\").Range(\"P2\").Value = UsrFrm.txtSalary.Value"]
[]
[null,null,null,null,"    "]
[null,null,null,null,"    Sheets(\"Employees\").Range(\"Tbl[#All]\").AdvancedFilter Action:=xlFilterCopy, _"]
[null,null,null,null,"        CriteriaRange:=Sheets(\"Filter\").Range(\"K1:P2\"), CopyToRange:=Sheets(\"Filter\").Range(\"A1:H1\"), Unique:=False"]
[]
[]
[null,null,null,null,"CntRows = Application.WorksheetFunction.CountA(Sheets(\"Filter\").Range(\"A:A\"))"]
[]
[null,null,null,null,"If CntRows = 1 Then"]
[null,null,null,null,"MsgBox \"Not Found!\""]
[null,null,null,null,"Me.ListBox.RowSource = \"Tbl\""]
[null,null,null,null,"Else"]
[]
[null,null,null,null,"Me.ListBox.RowSource = \"Filter!A2:H\" & CntRows"]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub btnShowData_Click()"]
[]
[null,null,null,null,"psw = InputBox(\"Please enter the password\")"]
[]
[null,null,null,null,"If psw = 1234 Then"]
[]
[null,null,null,null,"Application.Visible = True"]
[]
[null,null,null,null,"Sheets(\"Employees\").Visible = True"]
[null,null,null,null,"Sheets(\"Employees\").Activate"]
[null,null,null,null,"UsrFrm.Hide"]
[]
[null,null,null,null,"Else"]
[null,null,null,null,"MsgBox \"The password is incorrect\""]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub Folder_Click()"]
[null,null,null,null,"Dim xDialog As FileDialog"]
[null,null,null,null,"Dim xFolder As String"]
[]
[null,null,null,null,"Set xDialog = Application.FileDialog(msoFileDialogFolderPicker)"]
[null,null,null,null,"    xDialog.Title = \"Select Destination Folder\""]
[null,null,null,null,"    xDialog.AllowMultiSelect = False"]
[null,null,null,null,"    If xDialog.Show = 0 Then Exit Sub"]
[null,null,null,null,"    "]
[null,null,null,null,"xFolder = xDialog.SelectedItems(1)"]
[]
[null,null,null,null,"Sheets(\"Employees\").Range(\"Tbl[Image]\").Replace UsrFrm.Folder.Caption, xFolder"]
[null,null,null,null,"UsrFrm.Folder.Caption = xFolder"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub ListBox_Click()"]
[null,null,null,null,"Dim UsrIndx As Long"]
[null,null,null,null,"UsrIndx = UsrFrm.ListBox.ListIndex"]
[]
[null,null,null,null,"UsrFrm.txtName.Value = UsrFrm.ListBox.List(UsrIndx, 1)"]
[null,null,null,null,"If UsrFrm.ListBox.List(UsrIndx, 2) = \"Male\" Then"]
[null,null,null,null,"UsrFrm.optMale = True"]
[null,null,null,null,"UsrFrm.optFemale = False"]
[]
[null,null,null,null,"Else"]
[null,null,null,null,"UsrFrm.optFemale = True"]
[null,null,null,null,"UsrFrm.optMale = False"]
[null,null,null,null,"End If"]
[]
[null,null,null,null,"UsrFrm.cmbJobStatus.Value = UsrFrm.ListBox.List(UsrIndx, 3)"]
[null,null,null,null,"UsrFrm.txtPhoneNumber.Value = UsrFrm.ListBox.List(UsrIndx, 4)"]
[null,null,null,null,"UsrFrm.cmbColumnData.Value = UsrFrm.ListBox.List(UsrIndx, 5)"]
[null,null,null,null,"UsrFrm.txtSalary.Value = UsrFrm.ListBox.List(UsrIndx, 6)"]
[null,null,null,null,"On Error Resume Next"]
[null,null,null,null,"UsrFrm.Image.Picture = LoadPicture(UsrFrm.ListBox.List(UsrIndx, 7))"]
[null,null,null,null,"UsrFrm.ImagePath.Caption = UsrFrm.ListBox.List(UsrIndx, 7)"]
[]
[null,null,null,null,"Me.btnEdit.Visible = True"]
[null,null,null,null,"Me.btnDelete.Enabled = True"]
[null,null,null,null,"Me.btnClear.Caption = \"Return\""]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub LS1_Click()"]
[null,null,null,null,"On Error Resume Next"]
[null,null,null,null,"With Me.ListBox"]
[null,null,null,null,"        ListBox.ListIndex = 0"]
[null,null,null,null,"    End With"]
[null,null,null,null,"End Sub"]
[null,null,null,null,"Private Sub LS2_Click()"]
[null,null,null,null,"On Error Resume Next"]
[null,null,null,null,"With Me.ListBox"]
[null,null,null,null,"        ListBox.ListIndex = Me.Count - 1"]
[null,null,null,null,"    End With"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub SpinButton2_SpinDown()"]
[null,null,null,null,"On Error Resume Next"]
[null,null,null,null,"If ListBox.ListIndex = ListBox1.ListCount - 1 Then Exit Sub"]
[null,null,null,null,"With Me.ListBox"]
[null,null,null,null,"        .ListIndex = .ListIndex + 1"]
[null,null,null,null,"    End With"]
[null,null,null,null,"    End Sub"]
[null,null,null,null,"Private Sub SpinButton2_SpinUp()"]
[null,null,null,null,"On Error Resume Next"]
[null,null,null,null,"If ListBox.ListIndex = 0 Then Exit Sub"]
[null,null,null,null,"With Me.ListBox"]
[null,null,null,null,"        .ListIndex = .ListIndex - 1"]
[null,null,null,null,"    End With"]
[null,null,null,null,"    End Sub"]
[null,null,null,null,"Private Sub UploadImage_Click()"]
[null,null,null,null,"    Dim xDialog As FileDialog"]
[null,null,null,null,"    Dim xImage As String"]
[]
[null,null,null,null,"    Set xDialog = Application.FileDialog(msoFileDialogFilePicker)"]
[null,null,null,null,"        xDialog.Title = \"Select Image\""]
[null,null,null,null,"        xDialog.AllowMultiSelect = False"]
[null,null,null,null,"        xDialog.Filters.Add \"Image Files\", \"*.gif; *.jpg; *.jpeg; *.png\" ' يمكنك إضافة المزيد من الامتدادات إذا لزم الأمر"]
[null,null,null,null,"        If xDialog.Show = 0 Then Exit Sub"]
[]
[null,null,null,null,"        xImage = xDialog.SelectedItems(1)"]
[]
[null,null,null,null,"    ' هنا يتم تحميل الصورة وعرض المسار في Label (كما في الكود الأصلي)"]
[null,null,null,null,"    UsrFrm.Image.Picture = LoadPicture(xImage)"]
[null,null,null,null,"    UsrFrm.ImagePath.Caption = xImage"]
[]
[null,null,null,null,"    ' إضافة مسار الصورة إلى TextBox1"]
[null,null,null,null,"    UsrFrm.TextBox1.Text = xImage"]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub UserForm_Activate()"]
[]
[null,null,null,null,"  T_resultat = \"عدد الموظفين\" & \"/\" & ListBox.ListCount + 0"]
[null,null,null,null,"   Count = ListBox.ListCount"]
[]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub UserForm_Initialize()"]
[]
[null,null,null,null,"    Me.ListBox.ColumnWidths = \"70;110;100;100;100;100;150;80;80\" ' مثال على عرض اتساع إضافي للعمودين"]
[]
[null,null,null,null,"  T_resultat = \"عدد الموظفين\" & \"/\" & ListBox.ListCount + 0"]
[null,null,null,null,"   Count = ListBox.ListCount"]
[]
[]
[null,null,null,null,"Dim ws As Worksheet"]
[null,null,null,null,"Dim lr As Integer"]
[null,null,null,null,"Set ws = Sheets(\"Employees\")"]
[null,null,null,null,"         lr = ws.Cells(Rows.Count, 1).End(xlUp).Row"]
[null,null,null,null,"'         series = Format(Val(ws.Cells(lr, 1)) + 1, \"00 00\")"]
[null,null,null,null,"         TextBox3 = Format(Val(ws.Cells(lr, 1)) + 1)"]
[null,null,null,null,"'    ' تحديد العنصر الأول في ListBox إذا كانت هناك عناصر"]
[null,null,null,null,"    If ListBox.ListCount > 0 Then"]
[null,null,null,null,"        ListBox.ListIndex = 0"]
[null,null,null,null,"End If"]
[null,null,null,null,"    ' عند تحميل النموذج، قم بملء ComboBox1 برؤوس الأعمدة"]
[null,null,null,null,"    Call PopulateHeaderComboBox"]
[null,null,null,null,"'lstData.ColumnWidths = (\"50,50,50,50,50,50,50,50,50,50\")"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub cmbHeader_Change()"]
[null,null,null,null,"    ' عند تغيير اختيار رأس العمود، قم بملء ComboBox2 بالقيم الفريدة من هذا العمود"]
[null,null,null,null,"    Call PopulateColumnDataComboBox"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub cmbColumnData_Change()"]
[null,null,null,null,"    ' عند تغيير اختيار القيمة في ComboBox2، اعرض القيمة في TextBox1 وقم بتصفية ListBox1"]
[null,null,null,null,"    txtSelectedValue.Text = cmbColumnData.Value"]
[null,null,null,null,"    Call FilterListBox"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Private Sub txtSelectedValue_Change()"]
[null,null,null,null,"    ' عند تغيير القيمة مباشرة في TextBox1، قم بتصفية ListBox1"]
[null,null,null,null,"    Call FilterListBox"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Sub PopulateHeaderComboBox()"]
[null,null,null,null,"    Dim ws As Worksheet"]
[null,null,null,null,"    Set ws = ThisWorkbook.Sheets(\"Employees\") ' استبدل \"اسم ورقة العمل\" باسم ورقتك"]
[]
[null,null,null,null,"    Dim lastColumn As Long"]
[null,null,null,null,"    lastColumn = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column"]
[]
[null,null,null,null,"    Dim i As Long"]
[null,null,null,null,"    With cmbHeader"]
[null,null,null,null,"        .Clear"]
[null,null,null,null,"        For i = 1 To lastColumn"]
[null,null,null,null,"            If Not IsEmpty(ws.Cells(1, i).Value) Then ' تأكد من أن الرأس ليس فارغًا"]
[null,null,null,null,"                .AddItem ws.Cells(1, i).Value"]
[null,null,null,null,"            End If"]
[null,null,null,null,"        Next i"]
[null,null,null,null,"    End With"]
[]
[null,null,null,null,"    ' حدد أول رأس عمود افتراضيًا إذا كان هناك رؤوس"]
[null,null,null,null,"    If cmbHeader.ListCount > 0 Then"]
[null,null,null,null,"        cmbHeader.ListIndex = 0"]
[null,null,null,null,"        Call PopulateColumnDataComboBox ' املأ ComboBox2 بناءً على أول رأس"]
[null,null,null,null,"    End If"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Sub PopulateColumnDataComboBox()"]
[null,null,null,null,"    Dim ws As Worksheet"]
[null,null,null,null,"    Set ws = ThisWorkbook.Sheets(\"Employees\") ' استبدل \"اسم ورقة العمل\" باسم ورقتك"]
[]
[null,null,null,null,"    Dim selectedHeader As String"]
[null,null,null,null,"    selectedHeader = cmbHeader.Value"]
[]
[null,null,null,null,"    Dim headerColumn As Long"]
[null,null,null,null,"    On Error Resume Next"]
[null,null,null,null,"    headerColumn = Application.Match(selectedHeader, ws.Rows(1), 0)"]
[null,null,null,null,"    On Error GoTo 0"]
[]
[null,null,null,null,"    If headerColumn > 0 Then"]
[null,null,null,null,"        Dim lastRow As Long"]
[null,null,null,null,"        lastRow = ws.Cells(ws.Rows.Count, headerColumn).End(xlUp).Row"]
[]
[null,null,null,null,"        Dim uniqueValues As Collection"]
[null,null,null,null,"        Set uniqueValues = New Collection"]
[]
[null,null,null,null,"        Dim i As Long"]
[null,null,null,null,"        On Error Resume Next ' لتجنب الخطأ عند محاولة إضافة قيمة مكررة"]
[null,null,null,null,"        For i = 2 To lastRow ' ابدأ من الصف الثاني لتجنب الرأس"]
[null,null,null,null,"            If Not IsEmpty(ws.Cells(i, headerColumn).Value) Then"]
[null,null,null,null,"                uniqueValues.Add ws.Cells(i, headerColumn).Value, CStr(ws.Cells(i, headerColumn).Value)"]
[null,null,null,null,"            End If"]
[null,null,null,null,"        Next i"]
[null,null,null,null,"        On Error GoTo 0"]
[]
[null,null,null,null,"        With cmbColumnData"]
[null,null,null,null,"            .Clear"]
[null,null,null,null,"            For Each Item In uniqueValues"]
[null,null,null,null,"                .AddItem Item"]
[null,null,null,null,"            Next Item"]
[null,null,null,null,"        End With"]
[]
[null,null,null,null,"        ' حدد أول قيمة فريدة افتراضيًا إذا كانت هناك قيم"]
[null,null,null,null,"        If cmbColumnData.ListCount > 0 Then"]
[null,null,null,null,"            cmbColumnData.ListIndex = 0"]
[null,null,null,null,"            txtSelectedValue.Text = cmbColumnData.Value"]
[null,null,null,null,"            Call FilterListBox ' قم بتصفية ListBox بناءً على أول قيمة"]
[null,null,null,null,"        Else"]
[null,null,null,null,"            txtSelectedValue.Text = \"\""]
[null,null,null,null,"            ListBox.Clear"]
[null,null,null,null,"        End If"]
[null,null,null,null,"    Else"]
[null,null,null,null,"        cmbColumnData.Clear"]
[null,null,null,null,"        txtSelectedValue.Text = \"\""]
[null,null,null,null,"        ListBox.Clear"]
[null,null,null,null,"    End If"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Sub FilterListBox()"]
[null,null,null,null,"    Dim ws As Worksheet"]
[null,null,null,null,"    Set ws = ThisWorkbook.Sheets(\"Employees\") ' استبدل \"اسم ورقة العمل\" باسم ورقتك"]
[]
[null,null,null,null,"    Dim selectedHeader As String"]
[null,null,null,null,"    selectedHeader = cmbHeader.Value"]
[]
[null,null,null,null,"    Dim filterValue As String"]
[null,null,null,null,"    filterValue = txtSelectedValue.Text"]
[]
[null,null,null,null,"    Dim headerColumn As Long"]
[null,null,null,null,"    On Error Resume Next"]
[null,null,null,null,"    headerColumn = Application.Match(selectedHeader, ws.Rows(1), 0)"]
[null,null,null,null,"    On Error GoTo 0"]
[]
[null,null,null,null,"    If headerColumn > 0 Then"]
[null,null,null,null,"        Dim lastRow As Long"]
[null,null,null,null,"        lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row ' نفترض أن العمود A دائمًا ممتلئ"]
[]
[null,null,null,null,"        Dim i As Long"]
[null,null,null,null,"        Dim rowData As String"]
[null,null,null,null,"        ListBox.Clear"]
[]
[null,null,null,null,"        Dim lastColumn As Long"]
[null,null,null,null,"        lastColumn = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column"]
[]
[null,null,null,null,"        For i = 2 To lastRow"]
[null,null,null,null,"            If InStr(1, CStr(ws.Cells(i, headerColumn).Value), filterValue, vbTextCompare) > 0 Then"]
[null,null,null,null,"                rowData = \"\""]
[null,null,null,null,"                Dim j As Long"]
[null,null,null,null,"                For j = 1 To lastColumn"]
[null,null,null,null,"                    rowData = rowData & ws.Cells(i, j).Value & vbTab"]
[null,null,null,null,"                Next j"]
[null,null,null,null,"                ListBox.AddItem rowData"]
[null,null,null,null,"            End If"]
[null,null,null,null,"        Next i"]
[]
[null,null,null,null,"        ' استدعاء الإجراء لضبط عرض الأعمدة تلقائيًا بعد ملء ListBox"]
[null,null,null,null,"        Call AutoSizeListBoxColumns"]
[null,null,null,null,"    Else"]
[null,null,null,null,"        ListBox.Clear"]
[null,null,null,null,"    End If"]
[null,null,null,null,"End Sub"]
[]
[null,null,null,null,"Sub AutoSizeListBoxColumns()"]
[null,null,null,null,"    Dim ws As Worksheet"]
[null,null,null,null,"    Set ws = ThisWorkbook.Sheets(\"Employees\")"]
[null,null,null,null,"    Dim lb As MSForms.ListBox ' استخدم MSForms.ListBox للتحديد الصحيح"]
[null,null,null,null,"    Set lb = Me.ListBox ' افترض أن الكود داخل UserForm"]
[]
[null,null,null,null,"    Dim colCount As Long"]
[null,null,null,null,"    colCount = lb.ColumnCount ' يجب تعيين ColumnCount بشكل صحيح"]
[]
[null,null,null,null,"    Dim maxChars() As Long"]
[null,null,null,null,"    ReDim maxChars(0 To colCount - 1) ' فهرس المصفوفة يجب أن يبدأ من 0 لتطابق أعمدة ListBox"]
[]
[null,null,null,null,"    Dim i As Long, j As Long"]
[]
[null,null,null,null,"    ' بعد ملء ListBox، قم بحساب أقصى طول لكل عمود"]
[null,null,null,null,"    For i = 0 To lb.ListCount - 1"]
[null,null,null,null,"        For j = 0 To colCount - 1"]
[null,null,null,null,"            If Len(lb.List(i, j)) > maxChars(j) Then"]
[null,null,null,null,"                maxChars(j) = Len(lb.List(i, j))"]
[null,null,null,null,"            End If"]
[null,null,null,null,"        Next j"]
[null,null,null,null,"    Next i"]
[]
[null,null,null,null,"    ' قم بتعيين ColumnWidths بناءً على أقصى طول (تقدير تقريبي)"]
[null,null,null,null,"    Dim widths As String"]
[null,null,null,null,"    For i = 0 To colCount - 1"]
[null,null,null,null,"        widths = widths & maxChars(i) * 8 & \";\" ' تقدير: 8 نقاط لكل حرف"]
[null,null,null,null,"    Next i"]
[null,null,null,null,"    If Len(widths) > 0 Then widths = Left(widths, Len(widths) - 1) ' إزالة الفاصلة المنقوطة الأخيرة"]
[null,null,null,null,"    lb.ColumnWidths = widths"]
[]
[null,null,null,null,"End Sub"]