รบกวนอาจารย์เพื่อนสมาชิก
ช่วยดูโค๊ด ที่ดิฉัน ทำให้มาให้หน่อยค่ะ
ความต้องการคือ
ต้องการปริ้นบิลที่มีในชีต บันทึกรายการซื้อขาย ตามเลขที่บิลในช่อง A8:A2000
พอกดรันแล้วเกิดเป็นบัค ขึ้นค่ะ
104675349_[attachment=1]104476437_265887077852175_5129502601957606481_n.png
4327725897252469_224922886446123285_n.png[/attachment]
ตัวอย่างโค๊ด
Code: Select all
Sub export_Bill()
Worksheets("Bill").Activate
Dim path As String
Dim i As Integer
Dim Filename As String
path = Range("Location").Value & "\"
'C:\Users\Admin\OneDrive\งานบ้านปูม้า\บัญชี2563\บิลซื้อขายประจำเดือน
For i = Range("Start").Value To Range("End").Value
Range("AY6").Value = i
Filename = path & Range("Ay6").Value & ".pdf"
Worksheets("Bill").ExportAsFixedFormat xlTypePDF, Filename
Next i
MsgBox " Done "
End Sub
รบกวนช่วยดูโค๊ดให้หน่อยค่ะ พร้อมแนบไฟล์ที่เกิดปัญหามาด้วยค่ะ
You do not have the required permissions to view the files attached to this post.