ผมติดปัญหาคือ
ผมต้องการให้จำนวนวัสดุลด เมื่อมีการจ่ายออก และจำนวนวัสดุเพิ่มเมื่อมีการนำเข้า
ผมมีไฟล์ที่เป็นข้อมูลสต๊อกสินค้า มีสว่านอยู่ 10 เครื่อง
เมื่อผมกรอกข้อมูลเพื่อจะเอาของออก ใส่จำนวนไป 5 เครื่อง
ในสต๊อกสินค้า สว่าน จะต้องเหลืออยู่ 5 เครื่อง
และเมื่อผมนำ สว่าน กลับมาหมด
ในสต๊อกสินค้า สว่าน จะต้องมีทั้งหมด 10 เครื่อง
ผมอยากจะทราบวิธีการเขียนครับ
Code: Select all
Private Sub CommandButton1_Click()
Sheet7.Activate
Dim rg As Range
Set rg = ActiveSheet.Columns(3).Find(TextBox1.Value)
If TextBox1.Text = "" Then
MsgBox "¡ÃسҡÃÍ¡¢éÍÁÙÅ", 0, "¡ÃسҡÃÍ¡¢éÍÁÙÅ"
ElseIf rg Is Nothing Then
MsgBox "ID not found"
Else
MsgBox rg.Address
Sheet6.Activate
Do
r = r + 1
Loop Until Cells(r, 1) = ""
Cells(r, 1) = r - 1
Cells(r, 2) = TextBox5.Value
Cells(r, 3) = TextBox1.Text
Cells(r, 4) = ComboBox1.Text
Cells(r, 5) = tb2.Value - num
Cells(r, 6) = ComboBox2.Text
Cells(r, 7) = TextBox3.Text
End If
End Sub
You do not have the required permissions to view the files attached to this post.