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

كود عمل زيادة واضافة تلقائية بإستمرار عند الإدخال


إذهب إلى أفضل إجابة Solved by Ali Mohamed Ali,

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

  • أفضل إجابة

وذلك بوضح هذه الأكواد بحدذ الصفحة

Public oldval As Double
Sub KH_TEST()
 oldval = 0
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If [x1] = False Then GoTo 1
If Not Intersect(Target, Range("C3:m101")) Is Nothing Then
    Application.EnableEvents = False
    If IsNumeric(Target) Then _
    Target = oldval + Target Else Target = oldval
      Application.EnableEvents = True
End If
1 End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If [x1] = False Then GoTo 1
If Not Intersect(Target, Range("C3:m101")) Is Nothing Then
    Application.EnableEvents = False
    If IsNumeric(Target) Then oldval = Target Else oldval = 0
    Application.EnableEvents = True
End If
1 End Sub

 

الصلاة١.xlsm

  • Like 3
  • Thanks 1
رابط هذا التعليق
شارك

بعد اذن استاد علي  كود بطريقة اخرى  انقر  على اي قيمة من الخلايا  المحددة سيطلع  مربع  حوار اكتب  القيمة وسيتم الاضافة 

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim xRtn As Variant
    If Selection.Count = 1 Then
        If Not Intersect(Target, Range("c:m")) Is Nothing Then
            If IsNumeric(Target) And Target <> "" Then
                xRtn = Application.InputBox("Insert your value please")
                If xRtn <> False And IsNumeric(xRtn) Then
                    Target.Value = Target + xRtn
                End If
            End If
        End If
    End If
End Sub

 

الصلاة2.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