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

دمج أكواد


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

الساده

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

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

                                 (إذا تم حفظ باسم وتغيير نوعية الملف - كأن شيئا لم يكن ويمكن عمل كل شىء على الملف)

هل ينفع جمع الكودين ليعملوا فى الملف

 

الكود الأول يعمل على الطباعة بكلمة سر

Private Sub Workbook_BeforePrint(Cancel As Boolean)
motpass = "123"
q1 = InputBox("Please enter your password!")
If q1 <> motpass Then
MsgBox ("Please enter your valid password!!"), vbCritical
Cancel = True
End If

End Sub

الكود الثانى يقفل قوائم الاكسيل

Sub Auto_Close()
Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim i As Integer
kh_wVisible False
ThisWorkbook.Close Not CBool(ThisWorkbook.Saved)
Application.DisplayFormulaBar = True
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Call ToggleCutCopyAndPaste(True)

Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub

وشكرا

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

rivate Sub Workbook_BeforePrint(Cancel As Boolean)
motpass = "123"

call auto_close
q1 = InputBox("Please enter your password!")


If q1 <> motpass Then
MsgBox ("Please enter your valid password!!"), vbCritical
Cancel = True

call auto_close

EndIf

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