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

حل لكود التلوين


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

الشيت ثقيل لانك تجعل الكود ينتظر ثانية واحدة  في كل خطوة من خلال الدالة  Wait

ما مجموعه (55 × 57 =4125 ثانية اي حوالي ساعة وربع)

جرب هذا الماكرو

Sub salama()
Application.ScreenUpdating = False
Dim My_num, i#, col#
Dim color_index%
color_index = 1 + 18 * Rnd()
 For i = 3 To 55
   For col = 2 To 57
     Select Case Cells(i, col)
       Case 1: My_num = 2
       Case 2: My_num = 3
       Case 3: My_num = 1
       Case Else: My_num = ""
      End Select
     Cells(i, col) = My_num
     Cells(i, col).Interior.colorindex = color_index
  Next
 Next
 Application.ScreenUpdating = True
 End Sub
 '===================================
  'هذا الكود للتصحيح في حال ادخال رقم مختلف بالخطأ
Sub reset()
Application.ScreenUpdating = False
Dim i#, col#
 For i = 3 To 55
  For col = 2 To 57
   If Cells(i, col) <> vbNullString Then _
   Cells(i, col) = 1
  Next
 Next
 Application.ScreenUpdating = True
End Sub

 

2030.xlsm

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

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