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

محتاجه مراجعه في اكواد VBA


didi2333
إذهب إلى أفضل إجابة Solved by حسونة حسين,

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


اولا رافض يمسح الخلايا اللي انا محدداها عند تنفيذ امر الحفظ
ثانيا محتاجه اشوف الاكواد كده صح ولا فيها حاجه غلط
ثالثا الايقونات محتاجاها تختفي في نسخه حفظ الملف الاكسيل لان عند الحفظ بيظهر الايقونات المستخدمه في
 vba 

لينكها ع درايف...

https://docs.google.com/spreadsheets/d/1Wtuifqe8q7i6YkhHvME_n8AbbX91GQkV/edit#gid=478253097

 

https://docs.google.com/spreadsheets/d/1Wtuifqe8q7i6YkhHvME_n8AbbX91GQkV/edit?usp=sharing&ouid=108525206872593668572&rtpof=true&sd=true

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

  • أفضل إجابة

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

جربى هذا التعديل

Sub SaveInvoiceBothWaysAndClear()
    Dim NewFN As String
    Dim Sh As Worksheet
    Application.DisplayAlerts = False
    Set Sh = ThisWorkbook.Worksheets("INVOICE")
'    Path and Name of the Files
    NewFN = "C:\Users\A12\Documents\invoice\Inv" & Sh.Range("E5").Value
    With Sh
'        Create the PDF First
        .ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN & ".pdf"
'        Export the Excel File
        .Copy
    End With
'    Deleting Shapes
    With ActiveSheet
        With .Shapes.Range(Array("Rounded Rectangle 1", "Rounded Rectangle 2", "Rounded Rectangle 5", "Rounded Rectangle 6", "Button 1", "Button 2"))
            .Select
            .Delete
        End With
'        Save the Excel File
        .SaveAs NewFN & ".xlsx", FileFormat:=xlOpenXMLWorkbook
    End With
'    Close the Excel File
    ActiveWorkbook.Close
'    Increment the invoice number
    Sh.Range("E5").Value = Sh.Range("E5").Value + 1
'    Clear out the invoice fields
    Sh.Range("A21:f37").ClearContents
    Application.DisplayAlerts = True
End Sub

 

  • Like 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