Cách dùng:
Sau khi nhập mới 1 record, bạn chọn ô bất kỳ nào thuộc dòng này & bấm tổ hợp fím dành sẵn cho macro
(húc thành công!
Option Explicit
Sub CapNhut()
Dim Sh As Worksheet, Cls As Range, sCls As Range
Dim ShN As String, Col As Byte
Const TTT As String = "EmaSEOOnlSEMCon___GPE"
Set Cls = Cells(Selection.Row, "B")
If Cls.Value = "" Then Exit Sub
For Each Sh In ThisWorkbook.Worksheets
ShN = Left(Sh.Name, 3)
If ShN <> "Ton" Then
If Not Sh.Columns("B:B").Find(Cls.Value, , xlFormulas, xlWhole) Is Nothing Then
MsgBox "Da Chép Nguòi Này": Exit Sub
Else
Col = (InStr(TTT, ShN) + 2) \ 3 + 3
With Sh.[B65500].End(xlUp).Offset(1)
.Resize(, 4).Value = Cls.Resize(, 4).Value
.Offset(, 5).Resize(, 2).Value = Cls.Offset(, 9).Resize(, 2).Value
.Offset(, 7).Value = Cls.Offset(, Col).Value
End With
End If
End If
Next Sh
End Sub
PHP:Option Explicit Sub CapNhut() Dim Sh As Worksheet, Cls As Range, sCls As Range Dim ShN As String, Col As Byte Const TTT As String = "EmaSEOOnlSEMCon___GPE" Set Cls = Cells(Selection.Row, "B") If Cls.Value = "" Then Exit Sub For Each Sh In ThisWorkbook.Worksheets ShN = Left(Sh.Name, 3) If ShN <> "Ton" Then If Not Sh.Columns("B:B").Find(Cls.Value, , xlFormulas, xlWhole) Is Nothing Then MsgBox "Da Chép Nguòi Này": Exit Sub Else Col = (InStr(TTT, ShN) + 2) \ 3 + 3 With Sh.[B65500].End(xlUp).Offset(1) .Resize(, 4).Value = Cls.Resize(, 4).Value .Offset(, 5).Resize(, 2).Value = Cls.Offset(, 9).Resize(, 2).Value .Offset(, 7).Value = Cls.Offset(, Col).Value End With End If End If Next Sh End Sub
Mình viết trong E2003 & hay BKAV xơi nó rồi cũng nên!