
Gửi bởi
bachduongstar
Tiện thể cho mình hỏi thêm, mình có làm command button để add dữ liệu, và code chạy được. Lệnh code như sau
"Private Sub Addbutton_Click()Dim emptyRow As Long
'Make Sheet1 active
Sheet1.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = txtID.Value
Cells(emptyRow, 2).Value = txtName.Value
Cells(emptyRow, 3).Value = CboGender.Value
Cells(emptyRow, 4).Value = txtAge.Value
Cells(emptyRow, 5).Value = txtAddress.Value
Cells(emptyRow, 6).Value = CDate(TextBox6.Value)
Cells(emptyRow, 7).Value = TextBox7.Value
Cells(emptyRow, 8).Value = ChbVomit.Value
Cells(emptyRow, 9).Value = ChbNausea.Value
Cells(emptyRow, 10).Value = ChbHeadache.Value
Cells(emptyRow, 11).Value = ChbAbdominal.Value
Cells(emptyRow, 12).Value = ChbDiarrhea.Value
Cells(emptyRow, 13).Value = ChbFever.Value
Cells(emptyRow, 14).Value = ChbDizziness.Value
Cells(emptyRow, 15).Value = ChbThirst.Value
Cells(emptyRow, 16).Value = txtOthers.Value
Cells(emptyRow, 17).Value = txtTimeeat.Value
Cells(emptyRow, 18).Value = CheckBox1.Value
Cells(emptyRow, 19).Value = CheckBox2.Value
Cells(emptyRow, 20).Value = CheckBox3.Value
Cells(emptyRow, 21).Value = CheckBox4.Value
Cells(emptyRow, 22).Value = CheckBox5.Value
Cells(emptyRow, 23).Value = CheckBox6.Value
Cells(emptyRow, 24).Value = CheckBox7.Value
Cells(emptyRow, 25).Value = CheckBox8.Value
Cells(emptyRow, 26).Value = CheckBox9.Value
Cells(emptyRow, 27).Value = CheckBox10.Value
End Sub"
Bây giờ mình muốn làm Tongle button là "Previous" và "Next", mình chưa học qua VBA bao giờ, cũng cố xem trên 4rum để bắt chước nhưng làm mãi vẫn chưa được. Bạn nào giúp được mình thì giúp với. Cảm ơn các bạn và cảm ơn 4rum.