اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

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

قام بنشر

جرب هذا الملف

الماكرو مرفق

 

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column <> 2 Or Target.Row < 2 Or Target.Cells.Count > 1 Then
Application.EnableEvents = True: Exit Sub
End If
ActiveSheet.Unprotect
    Cells(Target.Row, 3).Locked = False
       If IsNumeric(Target) And Target >= 10 Then
  Cells(Target.Row, 3).Locked = True
            ActiveSheet.Protect
      End If
Application.EnableEvents = True
End Sub

 

Demand Macro_salim.rar

قام بنشر
منذ ساعه, سليم حاصبيا said:

جرب هذا الملف

الماكرو مرفق

 


Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column <> 2 Or Target.Row < 2 Or Target.Cells.Count > 1 Then
Application.EnableEvents = True: Exit Sub
End If
ActiveSheet.Unprotect
    Cells(Target.Row, 3).Locked = False
       If IsNumeric(Target) And Target >= 10 Then
  Cells(Target.Row, 3).Locked = True
            ActiveSheet.Protect
      End If
Application.EnableEvents = True
End Sub

 

Demand Macro_salim.rar

تم التعديل باضافة سطر واحد علة الكود

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column <> 2 Or Target.Row < 2 Or Target.Cells.Count > 1 Then
Application.EnableEvents = True: Exit Sub
End If
ActiveSheet.Unprotect
    Cells(Target.Row, 3).Locked = False
       If IsNumeric(Target) And Target >= 10 Then
       Cells(Target.Row, 3) = ""
       Cells(Target.Row, 3).Locked = True
            ActiveSheet.Protect
      End If
Application.EnableEvents = True
End Sub

 

قام بنشر
15 ساعات مضت, المسلم العربي said:

شكرا لك سيدي و اخر سؤال كيف اطبق هذه العملية على اعمدة مختلفة و شكرا جزيلا

حدد اي اعمدة تريد العمل عليها

الكود المطلوب

6 دقائق مضت, سليم حاصبيا said:

حدد اي اعمدة تريد العمل عليها

الكود المطلوب


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column < 7 Or Target.Column > 29 _
Or Target.Row < 2 Or Target.Cells.Count > 1 _
Or Target.Column Mod 2 = 0 Then
Application.EnableEvents = True: Exit Sub
End If
ActiveSheet.Unprotect
    Cells(Target.Row, Target.Column + 1).Locked = False
       If IsNumeric(Target) And Target >= 10 Then
       Cells(Target.Row, Target.Column + 1) = ""
       Cells(Target.Row, Target.Column + 1).Locked = True
            ActiveSheet.Protect
      End If
Application.EnableEvents = True
End Sub

 

 

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