สั่งพิมพ์เอกสารไม่ได้
Posted: Fri Mar 13, 2020 11:05 am
รบกวนช่วยดูโค๊ดให้หน่อยค่ะ
สั่งพิมเอกสารแล้วมันขึ้นerror
พยายามแก้แต่ไม่รู้ว่าเพราะอะไรค่ะ
ขอบคุณค่ะ
สั่งพิมเอกสารแล้วมันขึ้นerror
พยายามแก้แต่ไม่รู้ว่าเพราะอะไรค่ะ
Code: Select all
Private Sub ComboBox2_Change()
Sheets("บ้านปูม้า").Range("B2").Value = ComboBox2.Value
บันทึกรายการซื้อขาย.TextBox66 = Sheets("บ้านปูม้า").Range("D2")
End Sub
Code: Select all
Private Sub CommandButton15_Click()
With Sheets("Bill")
.Range("H7") = ComboBox20.Value
.Range("F6") = TextBox1.Value
.Range("E7") = ComboBox2.Value
.Range("C11") = ComboBox3.Value
.Range("D11") = TextBox2.Value
.Range("E11") = TextBox3.Value
.Range("F11") = TextBox4.Value
.Range("C12") = ComboBox4.Value
.Range("D12") = TextBox5.Value
.Range("E12") = TextBox6.Value
.Range("F12") = TextBox7.Value
.Range("C13") = ComboBox5.Value
.Range("D13") = TextBox8.Value
.Range("E13") = TextBox9.Value
.Range("F13") = TextBox10.Value
.Range("C14") = ComboBox6.Value
.Range("D14") = TextBox11.Value
.Range("E14") = TextBox12.Value
.Range("F14") = TextBox13.Value
.Range("C15") = ComboBox7.Value
.Range("D15") = TextBox14.Value
.Range("E15") = TextBox15.Value
.Range("F15") = TextBox16.Value
.Range("C16") = ComboBox8.Value
.Range("D16") = TextBox17.Value
.Range("E16") = TextBox18.Value
.Range("F16") = TextBox19.Value
.Range("C17") = ComboBox9.Value
.Range("D17") = TextBox20.Value
.Range("E17") = TextBox21.Value
.Range("F17") = TextBox22.Value
.Range("C18") = ComboBox10.Value
.Range("D18") = TextBox23.Value
.Range("E18") = TextBox24.Value
.Range("F18") = TextBox25.Value
.Range("C19") = ComboBox11.Value
.Range("D19") = TextBox26.Value
.Range("E19") = TextBox27.Value
.Range("F19") = TextBox28.Value
.Range("C20") = ComboBox12.Value
.Range("D20") = TextBox29.Value
.Range("E20") = TextBox30.Value
.Range("F20") = TextBox31.Value
.Range("C21") = ComboBox13.Value
.Range("D21") = TextBox32.Value
.Range("E21") = TextBox33.Value
.Range("F21") = TextBox34.Value
.Range("C22") = ComboBox14.Value
.Range("D22") = TextBox35.Value
.Range("E22") = TextBox36.Value
.Range("F22") = TextBox37.Value
.Range("C23") = ComboBox15.Value
.Range("D23") = TextBox38.Value
.Range("E23") = TextBox39.Value
.Range("F23") = TextBox40.Value
.Range("C24") = ComboBox16.Value
.Range("D24") = TextBox41.Value
.Range("E24") = TextBox42.Value
.Range("F24") = TextBox43.Value
.Range("C25") = ComboBox17.Value
.Range("D25") = TextBox44.Value
.Range("E25") = TextBox46.Value
.Range("F25") = TextBox47.Value
.Range("C26") = ComboBox18.Value
.Range("D26") = TextBox48.Value
.Range("E26") = TextBox50.Value
.Range("F26") = TextBox51.Value
.Range("C27") = ComboBox19.Value
.Range("D27") = TextBox52.Value
.Range("E27") = TextBox54.Value
.Range("F27") = TextBox55.Value
.Range("D35") = TextBox62.Value
.Range("D29") = TextBox64.Value
.Range("E29") = TextBox65.Value
.Range("D31") = TextBox67.Value
.Range("E31") = TextBox68.Value
.Range("G31") = TextBox69.Value
End With
ComboBox20.Text = " "
TextBox1.Text = " "
ComboBox2.Text = " "
TextBox60.Text = " "
TextBox61.Text = " "
TextBox58.Text = " "
ComboBox3.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
TextBox4.Text = " "
ComboBox4.Text = " "
TextBox5.Text = " "
TextBox6.Text = " "
TextBox7.Text = " "
ComboBox5.Text = " "
TextBox8.Text = " "
TextBox9.Text = " "
TextBox10.Text = " "
ComboBox6.Text = " "
TextBox11.Text = " "
TextBox12.Text = " "
TextBox13.Text = " "
ComboBox7.Text = " "
TextBox14.Text = " "
TextBox15.Text = " "
TextBox16.Text = " "
ComboBox8.Text = " "
TextBox17.Text = " "
TextBox18.Text = " "
TextBox19.Text = " "
ComboBox9.Text = " "
TextBox20.Text = " "
TextBox21.Text = " "
TextBox22.Text = " "
ComboBox10.Text = " "
TextBox23.Text = " "
TextBox24.Text = " "
TextBox25.Text = " "
ComboBox11.Text = " "
TextBox26.Text = " "
TextBox27.Text = " "
TextBox28.Text = " "
ComboBox12.Text = " "
TextBox29.Text = " "
TextBox30.Text = " "
TextBox31.Text = " "
ComboBox13.Text = " "
TextBox32.Text = " "
TextBox33.Text = " "
TextBox34.Text = " "
ComboBox14.Text = " "
TextBox35.Text = " "
TextBox36.Text = " "
TextBox37.Text = " "
ComboBox15.Text = " "
TextBox38.Text = " "
TextBox39.Text = " "
TextBox40.Text = " "
ComboBox16.Text = " "
TextBox41.Text = " "
TextBox42.Text = " "
TextBox43.Text = " "
ComboBox17.Text = " "
TextBox44.Text = " "
TextBox46.Text = " "
TextBox47.Text = " "
ComboBox18.Text = " "
TextBox48.Text = " "
TextBox50.Text = " "
TextBox51.Text = " "
ComboBox19.Text = " "
TextBox52.Text = " "
TextBox54.Text = " "
TextBox55.Text = " "
TextBox62.Text = " "
TextBox64.Text = " "
TextBox65.Text = " "
TextBox66.Text = " "
TextBox67.Text = " "
TextBox68.Text = " "
TextBox69.Text = " "
MsgBox "พิมใบสั่งงานเรียนร้อย"
Unload Me
Worksheets("Bill").PrintPreview
ActiveWorkbook.Save
wNext:
End Sub