ตรงนี้ทำได้แล้วขอบคุณมากค่ะ
ขอสอบถามเพิ่มค่ะ คือ ติดตรงบันทึกข้อมูลค่ะ ถ้าเลือก checkbox 1 อัน เวลาบันทึก ข้อมูลจะไม่ถูกบันทึกลงในชีท ''การรับ" ต้องเลือก 2 อันถึงจะบันทึกได้ค่ะ ต้องแก้ตรงไหนค่ะ
Code: Select all
'Save
Private Sub btsave_Click()
On Error Resume Next
Dim emptyRow As Integer
Dim strTb1 As Variant
Dim strTb3 As Variant
emptyRow = WorksheetFunction.Count("A3:A10000") + 1
If emptyRow = 0 Then
emptyRow = 2
Else
emptyRow = emptyRow + 2
Sheet9.Activate
strTb1 = Split(TextBox1.Text, vbCrLf)
strTb3 = Split(TextBox3.Text, vbCrLf)
Cells(emptyRow, 1).Value = VBA.Mid(strTb1(0), InStr(strTb1(0), ":") + 1) 'TextBox1.Value
Cells(emptyRow, 2).Value = VBA.Mid(strTb1(1), InStr(strTb1(1), ":") + 1) 'TextBox1.Value
Cells(emptyRow, 3).Value = VBA.Mid(strTb1(2), InStr(strTb1(2), ":") + 1) 'TextBox1.Value
Cells(emptyRow, 4).Value = VBA.Mid(strTb1(3), InStr(strTb1(3), ":") + 1) 'TextBox1.Value
Cells(emptyRow, 6).Value = strTb3(1) & "," & strTb3(2) & "," & strTb3(3) & vbCrLf & strTb3(4) & "," & strTb3(5) & "," & strTb3(6) 'TextBox3.Value
Cells(emptyRow, 7).Value = VBA.Mid(strTb3(7), InStr(strTb3(7), ":") + 1) & "," & VBA.Mid(strTb3(8), InStr(strTb3(8), ":") + 1) 'TextBox1.Value
Cells(emptyRow, 5).Value = comday.Value & "/" & commonth.Value & "/" & comyear.Value
MsgBox "บันทึกข้อมูลสำเร็จ"
Unload Me
Sheet1.Activate
End If
End Sub
You do not have the required permissions to view the files attached to this post.