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

الزام المستخدم بالكتابة بالترتيب في نفس الصف داخل الجدول


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

في الملف المرفق عندنا جدول من A1  الى F8 وعلى المستخدم ان يملؤه بالترتيب (في كل صف)

مثلا اذا قمت بالكتابة في الخلية D4  و كان ما قبلها فارغاً (C4) يقوم الدكتور اكسل بمسح ما قمت بكتابته بعد الخروج من الخلية دون انذار

و اذا حذفت اول خلية بالصف يتم حذف كامل الصف

الكود

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Not Intersect(Target, Range("A1:F8")) Is Nothing Then
   If Target.Count = 1 Then
     del_to_Column (Target.Row)
   End If
End If

Application.EnableEvents = True
End Sub
'================================
Sub del_to_Column(R)
Dim My_rg As Range, R_Empty As Range
Dim Col%
    
    Set My_rg = Cells(R, 1).Resize(, 6)
    Col = My_rg.Columns.Count
    Set R_Empty = My_rg.Find(vbNullString, After:=Cells(R, 6))

If Not R_Empty Is Nothing Then
 R_Empty.Resize(, Col - R_Empty.Column + 1) = vbNullString
End If

End Sub

الملف مرفق

write_by_order.xlsm

  • Like 6
رابط هذا التعليق
شارك

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