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

كيف نشغل الكودين مع بعض


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

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

  • أفضل إجابة

يمكنك استخدام الكود هكذا فى حدث ThisWorkBook

  Private Sub Workbook_Open()
                          
  ActiveWorkbook.Sheets(1).Select
  Range("a1").Activate
   Dim aa As Byte
                           
 If IsNull(Range("b65535").Value) Then
   Range("b65535").Value = 1
     End If
                          
    aa = Range("b65535").Value
                           
     If aa = 5 Then
       MsgBox "Used for 5 times , no more use is allowed !!"
        Application.ActiveWorkbook.Close
         Exit Sub
         Else
     Dim bb As String
         bb = Str(aa + 1)
          MsgBox "This File was used " & bb & "  Times "
         End If
                          
       Range("b65535").Value = aa + 1
    Application.ActiveWorkbook.Save
        If Date >= DateValue("26/6/2021") Or Sheets("Sheet1").Range("S1") >= Date Then
           Sheets("Sheet1").Range("S1") = Date
           MsgBox " expire انتهت صلاحية الملف "
          ThisWorkbook.Save
           Application.Quit
           End If
           End Sub

 

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

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