▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
กระทู้ที่คุณอาจสนใจ
อ่านกระทู้อื่นที่พูดคุยเกี่ยวกับ
การออกแบบฐานข้อมูล
การพัฒนาซอฟต์แวร์
VB (Visual Basic)
Microsoft Excel
วิศวกรรมคอมพิวเตอร์
รบกวนช่วยเเก้ VBA รับค่าจาก Userform ไปใส่ในตาราง Excel โดยไม่ให้ข้อมูลซ้ำกันหน่อยครับ
Private Sub CommandButton1_Click()
Dim onewrow As ListRow
Dim rng As Range
Set rng = ThisWorkbook.Worksheets("INVENTORY DATA").Range("inventory")
rng.Select
Set onewrow = Selection.ListObject.ListRows.Add(AlwaysInsert:=ture)
With ws
onewrow.Range.Cells(1, 1).Value = Me.TextBox1.Value
onewrow.Range.Cells(1, 2).Value = Me.TextBox3.Value
onewrow.Range.Cells(1, 3).Value = Me.ComboBox1.Value
onewrow.Range.Cells(1, 4).Value = Me.TextBox5.Value
onewrow.Range.Cells(1, 5).Value = Me.TextBox4.Value
onewrow.Range.Cells(1, 8).Value = Me.TextBox6.Value
End With
Me.TextBox1.Value = ""
Me.TextBox3.Value = ""
Me.ComboBox1.Value = ""
Me.TextBox5.Value = ""
Me.TextBox4.Value = ""
Me.TextBox6.Value = ""
End Sub