اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

  • أفضل إجابة
قام بنشر

وعليكم السلام ورحمة الله تعالى وبركاته 

جرب هدا 

Private Sub addbtn_Click()
Dim n As Long
Dim src As Worksheet: Set src = Sheets("Data")
n = Application.WorksheetFunction.CountA(src.Range("B:B")) + 1
If Me.studname = "" Then: Exit Sub

src.Cells(n, 2) = Me.cod.Value
src.Cells(n, 3) = Me.studname.Value
src.Cells(n, 4) = Me.row.Value
src.Cells(n, 5) = Me.class.Value
src.Cells(n, 6) = Me.group.Value
src.Cells(n, 7) = Me.studcase.Value
src.Cells(n, 8) = Me.birthdate.Value
src.Cells(n, 9) = Me.mother.Value
src.Cells(n, 10) = Me.gender.Value
src.Cells(n, 11) = Me.mobile.Value
src.Cells(n, 12) = Me.subcase.Value
src.Cells(n, 13) = Me.adress.Value
src.Cells(n, 14) = Me.datenow.Value
src.Cells(n, 15) = Me.employ.Value
src.Cells(n, 16) = Me.notes.Value

 With src.Range("A2:A" & src.Cells(src.Rows.Count, "B").End(xlUp).row)
    .Value = Evaluate("ROW(" & .Address & ")")
  End With
arr = Array("studname", "cod", "row", "birthdate", "class", "studcase", "mobile", _
             "notes", "group", "mother", "gender", "subcase", "adress")
For i = 0 To UBound(arr): Me.Controls(arr(i)).Value = Empty: Next i
   MsgBox "تمت عملية التسجيل بنجاح"
'ActiveWorkbook.Save
End Sub

دوبل كليك على الصف الاول من ورقة Data لاظهار اليوزرفورم

 

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Application.Intersect(Target, Range("A1:P1")) Is Nothing Then
        Cancel = True
        ADD.Show
    End If
End Sub

 

school data 2025x V2.xlsm

  • Like 3

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information