doanhoanghai
Thành viên hoạt động



- Tham gia
- 20/12/07
- Bài viết
- 195
- Được thích
- 4
Private Sub CommandButton1_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With Sheets("Sheet1")
.Cells(irow, 1).Value = Me.TextBox1.Value
.Cells(irow, 2).Value = Me.TextBox2.Value
End With
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
End Sub
End Sub
code ơ trên cũng không hoạt động được luôn nhé! hehhêCó mỗi cái code "Thêm". Các code khác chưa luyện đến
Mã:Private Sub CommandButton1_Click() Dim irow As Long Dim ws As Worksheet Set ws = Worksheets("Sheet1") irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row With Sheets("Sheet1") .Cells(irow, 1).Value = Me.TextBox1.Value .Cells(irow, 2).Value = Me.TextBox2.Value End With Me.TextBox1.Value = "" Me.TextBox2.Value = "" End Sub End Sub
irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
irow = ws.Cells(Rows.Count, 1).End(xlUp).Row+1
pác xem file này nhé rồi học hỏi có gì thì làm tiếp nhé! hehetrời đất sao mình làm mãi mà không đc nhỉ bác làm luôn cho thằng em này cái nào ! để em học hỏi thêm bác đưa mỗi code em làm mãi có đc đâu ! thank![]()