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

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

قام بنشر

أولا السلام عليكم ورحمة الله

لى طلب بشرح هذا الكود


Private Sub Worksheet_Change(ByVal Target As Range)

On Error Resume Next

If Me.[T1] Then Exit Sub

    If Not Application.Intersect(Target, Range("myrange")) Is Nothing Then

	    Application.EnableEvents = False

	    Application.Undo

	    Application.EnableEvents = True

    End If

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error Resume Next

    Dim Rng As Range

    Static Cell As Range

    Static TheFormula As String

    Set Rng = Range("myrange")

    If Not Application.Intersect(Target, Rng) Is Nothing Then

	    If Not Cell Is Nothing Then

		    Cell.Formula = TheFormula

	    End If

	    Set Cell = ActiveCell

	    With Cell

		    TheFormula = .Formula

		    .Value = .Value

	    End With

    Else

	    With Cell

		    .Formula = TheFormula

	    End With

    End If


End Sub

باعتبار أن النطاق myrange نطاق محدد ما هو المراد بـ

If Me.[T1] Then Exit Sub

قام بنشر

اخي الفاضل خلية T1 معيار

اذا كان مكتوب فيها True لايعمل استرجاع ماقبل الحركة الاخيره في الخليه

واذا كان مكتوب فيها False ينشط كود الاسترجاع

والله اعلم

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