Scan Barcode เก็บข้อมูลต่อเนื่อง โดยที่ไม่ต้องกดสั่ง
Posted: Tue Dec 20, 2022 7:49 pm
อยาก Scan Barcode จากช่อง UserForm(ช่องBarcode) ให้ข้อมูลไปขึ้นที่ คอรัม Column C อัตโนมัติ เเละ พร้อมที่จะScan Barcode ถัดไปได้ต่อเนื่อง จากสูตรที่เขียน ตัวเลขมันเรียงลงมาเป็นเเนวตั้ง อยากให้เรียงเป็น Barcode 13 หลัก
สูตรที่เขียน
Private Sub TextBox3_Change()
Do
R = R + 1
Loop Until Cells(R, 1) = ""
Cells(R, 1) = TextBox1.Text
Cells(R, 2) = TextBox2.Text
Cells(R, 3) = TextBox3.Text
TextBox3.SetFocus
Me.TextBox3.Text = ""
End Sub
สูตรที่เขียน
Private Sub TextBox3_Change()
Do
R = R + 1
Loop Until Cells(R, 1) = ""
Cells(R, 1) = TextBox1.Text
Cells(R, 2) = TextBox2.Text
Cells(R, 3) = TextBox3.Text
TextBox3.SetFocus
Me.TextBox3.Text = ""
End Sub