Private Sub CmdEdit_Click()
Dim MyMsg As Long, MyRng As Range, i As Byte
If TextBox10.Value <> vbNullString Then
MyMsg = MsgBox("Ban co chac chan nhap chinh sua toan bo du lieu cua Ma HS: " & TextBox10, vbQuestion + vbYesNo, "Thông Báo")
If MyMsg = vbYes Then
With Range(Sheets("DSHS").[L4], Sheets("DSHS").[L65536].End(xlUp))
Set MyRng = .Find(TextBox10.Value, LookIn:=xlValues, LookAt:=xlWhole)
End With
If Not MyRng Is Nothing Then
With MyRng
.Offset(, -10) = CboHoTen
For i = 1 To 10
.Offset(, i - 10) = Controls("TextBox" & i).Value
Next
End With
End If
CboHoTen.List() = Range(Sheets("DSHS").[B4], Sheets("DSHS").[B65536].End(xlUp)).Resize(, 11).Value
MsgBox "toan bo du lieu cua Ma HS: " & TextBox10 & " da duoc chinh sua!"
Call CmdClear_Click
End If
End If
End Sub