tôi có frm_timkiem co 1 txthoten khi nhập vào họ tên học sinh từ sheet DS_TrungTuyen thi thông tin tìm kiếm được sẽ chuyến sang sheet TIMKIEM tui đã viết code nhưng không tìm thấy gì cả! xem giùm code cho tui với
PHP:
Private Sub cmdtimkiem_Click()
Dim i, j As Integer
Dim HoTen
Dim c1, c2
For i = 8 To 100
HoTen = CStr(txthoten.Text)
Sheets("DS_TrungTuyen").Select
c1 = Cells(i, 8).Value
If ActiveCell.FormulaR1C1 Like UserForm1.txthoten.Text Then
Range(Cells(i, 2), Cells(i, 9)).Select
Selection.Copy
Sheets("TIMKIEM").Select
Cells(j + 8, 1).Value = j + 1
Range(Cells(j + 8, 2), Cells(j + 8, 9)).Select
'ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteValues ' Phai su dung cai nay moi duoc
Application.CutCopyMode = False
j = j + 1
End If
Next
Sheets("TIMKIEM").Select
End Sub
Chỉnh sửa lần cuối bởi điều hành viên: