EXCEL TOOLS
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
[code]
และปิดด้วย [/code]
ตัวอย่างเช่น [code]dim r as range[/code]
เพื่อให้แตกต่างจากข้อความทั่วไป สะดวกในการอ่านและทดสอบ (คลิกเพื่อดูตัวอย่าง)Code: Select all
Sub SaveAllPdf()
Dim sFolderPath As String
Dim Path As String
Dim FName As String
On Error Resume Next
Application.ScreenUpdating = False
sFolderPath = "C:\" & "TestPDF"
If Dir(sFolderPath, vbDirectory) = "" Then
MkDir sFolderPath
End If
FName = "PrintTest"
Application.DisplayAlerts = False
ActiveWorkbook.ExportAsFixedFormat xlTypePDF, From:=1, To:=5, Filename:=sFolderPath & "\" & FName
Application.DisplayAlerts = True
Application.ScreenUpdating = True
If MsgBox("ส่งออกไฟล์ไปไว้ที " & sFolderPath & vbCrLf & "ต้องการเปิด Folder กด Yes ไม่ต้องการ กด No ", 36, "Open Folder") = 6 Then
ActiveWorkbook.FollowHyperlink Address:=sFolderPath, NewWindow:=True
End If
End Sub
Code: Select all
ActiveWorkbook.ExportAsFixedFormat xlTypePDF, From:=1, To:=5, Filename:=sFolderPath & "\" & FName
Code: Select all
ThisWorkbook.Sheets(Array("Sheet1", "Sheet4", "Sheet5")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=sFolderPath & "\" & FName