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

المعادلات لا تعمل تلقائياً


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

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

 

لدى مجموعه ملفات أردت التعديل دفعه واحده بإضافه معادلات عليها بواسطه ماكرو ، وتمت العمليه بنجاح

لكن واجهتنى مشكله وهى عدم تفعيل المعادلات تلقائيا ولابد من الدخول على 

ادوات - خيارات - حساب - وجعل طريقه الحساب تلقائى << لكن المشكله انهم أكثر من 2500 ملف وسيكون التعديل مرهق جدا

 

هل هناك ماكرو اخر اقوم بتشغيله ليقوم بتعديل طريقه الحساب دفعه واحده على جميع الملفات ؟

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

أخي الكريم سامح

جرب الكود التالي

Sub LoopThroughClosedWBs()
    Dim WBK         As Workbook
    Dim FolderPath  As String
    Dim FileName    As String
    Dim Counter     As Double
    Dim Sh          As Worksheet
    
    'ضع المصنف الذي يحتوي الكود في نفس مسار الملفات المراد العمل عليها
    FolderPath = ThisWorkbook.Path & "\"
    FileName = Dir(FolderPath & "*.xl*")
    
    Application.ScreenUpdating = False
    
        Do While FileName <> ""
            If FileName <> ThisWorkbook.Name Then
                Application.Calculation = xlManual
                    Set WBK = Workbooks.Open(FolderPath & FileName)
                    
                    With WBK.Sheets("Sheet1")
                        .Range("E1").Formula = "=SUM(A1:B1)"
                    End With
                Application.Calculation = xlAutomatic
                WBK.Close SaveChanges:=True
            End If
            
            FileName = Dir()
        Loop
    
    Application.Calculation = xlAutomatic
    Application.ScreenUpdating = True
    
    MsgBox "Finished ...", 64
End Sub

في السطر قبل حفظ وإغلاق المصنف يتم وضع السطر التالي

Application.Calculation = xlAutomatic

تقبل تحياتي

  • 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