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

مساعدة فى الطباعة


إذهب إلى أفضل إجابة Solved by أ / محمد صالح,

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

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

هذا الملف تم بمساعدة حضراتكم 

الرجاء من حضراتكم اضافة اختصار للطباعة بحيث تطبع ال 45 ورقة مرة واحدة بامر واحد بحيث يكون فى اختيارين للطباعة فردية وجماعية فى الصفحة رقم 3 

هل ده متاح ولا مينفعش وشكر 

وائل عيد - Copy.xlsm

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

  • أفضل إجابة

لعل هذا هو المطلوب

تم استعمال الخلية T1 لاختيار طريقة الطباعة فردي أو جماعي

تغيير كود الاجراء text إلى

Sub text()
printtype = N.Range("t1")
If printtype = "فردي" Then
x = InputBox("من فضلك ادخل الرقم القومى مع تحياتى اشرف صبور ")
N.Range("t2") = x
On Error GoTo mm
i = Application.WorksheetFunction.Match(N.Range("t2"), DB.Range("c:c"), 0)
Call filldata(i)
N.PrintPreview
Call cler
Exit Sub
mm:
MsgBox "الرقم القومى غير موجود مع تحياتى اشرف صبور"
Else
lr = DB.Cells(Rows.Count, 3).End(3).Row
For r = 13 To lr
filldata (r)
ActiveSheet.PrintOut
Next r
Call cler
End If
End Sub

وفي حالة اختيار جماعية يتم طباعة الأرقام من الصف 13 إلى آخر صف مكتوب فيه

lr = DB.Cells(Rows.Count, 3).End(3).Row
For r = 13 To lr

وحتى لا نكرر كود تعبئة الخلايا تم فصل كود التعبئة في إجراء منفصل مع تمرير رقم الصف المراد طباعته إليه

Sub filldata(i)
   N.Range("c7") = DB.Cells(i, "g")
   N.Range("c8") = DB.Cells(i, "ci")
   N.Range("g7") = DB.Cells(i, "b")
   N.Range("g8") = DB.Cells(i, "c")
   N.Range("c9") = DB.Cells(i, "f")
   N.Range("c13") = DB.Cells(i, "i")
   N.Range("e13") = DB.Cells(i, "j")
   N.Range("b16") = DB.Cells(i, "l")
   N.Range("c16") = DB.Cells(i, "m")
   N.Range("d16") = DB.Cells(i, "n")
   N.Range("b22") = DB.Cells(i, "af")
   N.Range("b23") = DB.Cells(i, "ao")
   N.Range("b24") = DB.Cells(i, "ax")
   N.Range("b25") = DB.Cells(i, "bg")
   N.Range("d20") = DB.Cells(i, "q")
   N.Range("d21") = DB.Cells(i, "y")
   N.Range("d22") = DB.Cells(i, "ah")
   N.Range("d23") = DB.Cells(i, "aq")
   N.Range("d24") = DB.Cells(i, "az")
   N.Range("d25") = DB.Cells(i, "bi")
   N.Range("d26") = DB.Cells(i, "bq")
   N.Range("d27") = DB.Cells(i, "by")
   N.Range("d29") = DB.Cells(i, "cf")
   N.Range("g20") = DB.Cells(i, "w")
   N.Range("g21") = DB.Cells(i, "ae")
   N.Range("g22") = DB.Cells(i, "an")
   N.Range("g23") = DB.Cells(i, "aw")
   N.Range("g24") = DB.Cells(i, "bf")
   N.Range("g25") = DB.Cells(i, "bo")
   N.Range("g26") = DB.Cells(i, "bw")
   N.Range("g27") = DB.Cells(i, "ce")
   N.Range("g28") = DB.Cells(i, "k")
   N.Range("f29") = DB.Cells(i, "cg")
   N.Range("e20") = DB.Cells(i, "s")
   N.Range("e21") = DB.Cells(i, "aa")
   N.Range("e22") = DB.Cells(i, "aj")
   N.Range("e23") = DB.Cells(i, "as")
   N.Range("e24") = DB.Cells(i, "bb")
   N.Range("e25") = DB.Cells(i, "bk")
   N.Range("e26") = DB.Cells(i, "bs")
   N.Range("e27") = DB.Cells(i, "ca")
   N.Range("f20") = DB.Cells(i, "t")
   N.Range("f21") = DB.Cells(i, "ab")
   N.Range("f22") = DB.Cells(i, "ak")
   N.Range("f23") = DB.Cells(i, "at")
   N.Range("f24") = DB.Cells(i, "bc")
   N.Range("f25") = DB.Cells(i, "bl")
   N.Range("f26") = DB.Cells(i, "bt")
   N.Range("f27") = DB.Cells(i, "cb")
   N.Range("c31") = DB.Cells(i, "cl")
   N.Range("g31") = DB.Cells(i, "cm")
End Sub

وأنصح دائما بدراسة وفهم الكود ومتغيراته وكائناته جيدا قبل تطبيقه على شيت آخر

بالتوفيق

طباعة فردي أو جماعي.xlsm

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

  • 3 weeks later...

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

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

واشتغلت به فعلا وبعد فترة اصبح لا يطبع الا فردى وليس جماعى فالرجاء جعله يطبع فردى وجماعى 

ويا ريت نضيف عليه تحديد الطباعة من رقم قومى كذا الى رقم قومى كذا 

شاكر لحضراتكم تعبكم معى

للطباعة - Copy.xlsm

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

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