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

تحويل معادلات الى كود يعمل تلقائي


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

حرب هذا الكود

مجرد ان تخرج من الصفحة ثم تعوداليها يقوم الكود بعمله

Option Explicit
Private lrc%, lrg%, My_St1$, My_St2$
Private Sub Worksheet_Activate()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Range("c2:c500").ClearContents
Range("g2:g500").ClearContents
lrc = Sheets("ورقة1").Cells(Rows.Count, "a").End(3).Row
lrg = Sheets("ورقة1").Cells(Rows.Count, "e").End(3).Row
My_St1 = "=COUNTIF($B$2:B2,B2)+RANK(B2,$B$2:$B$32)-1"
My_St2 = "=VLOOKUP(E2,$A$2:$C$32,3,0)"
auto_formula
End Sub

Sub auto_formula()
Range("c2:c" & lrc).Formula = My_St1: Range("c2:c" & lrc).Value = Range("c2:c" & lrc).Value
Range("g2:g" & lrg).Formula = My_St2: Range("g2:g" & lrg).Value = Range("g2:g" & lrg).Value
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
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