tuandat106
Thành viên mới

- Tham gia
- 19/4/11
- Bài viết
- 49
- Được thích
- 2
Sub Update()
Dim NoFind As Range
Set NoFind = Sheets("TONGHOP").Range("A6:A65536").Find([D2], , xlFormulas, xlWhole)
Sheets("Chitiet").Range("D4:D43").Copy
Sheets("TongHop").Cells(NoFind.Row, 7).PasteSpecial xlPasteValues, Transpose:=True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NoFind As Range
If Target.Address = "$D$2" Then
Set NoFind = Sheets("TONGHOP").Range("A6:A65536").Find([D2], , xlFormulas, xlWhole)
If Not NoFind Is Nothing Then
With Sheets("TONGHOP")
.Range(.Cells(NoFind.Row, 7), .Cells(NoFind.Row, 46)).Copy
End With
[D4].PasteSpecial xlPasteValues, Transpose:=True
End If
End If
End Sub