Sub TongCong()
Dim fd As FileDialog
Dim wb As Workbook, sh As Worksheet, ra As Range, wb1 As Workbook, sh1 As Worksheet, ra1 As Range
Dim idx As Long
Dim sItem As Variant
Application.ScreenUpdating = False
Set wb1 = ThisWorkbook
Set sh1 = wb1.Sheets("TaiChinh")
Set ra1 = sh1.Range("D12:D40")
'sh1.Unprotect ("")'
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "XLS", "*.XLS"
'.InitialFileName = ""'
If .Show = -1 Then
For Each sItem In .SelectedItems
Set wb = Workbooks.Open(sItem)
Set sh = wb.Sheets("TaiChinh")
Set ra = sh.Range("D12:D40")
For idx = 1 To ra1.Rows.Count
If Trim(ra1(idx, 1)) = "" And Not ra1(idx, 1).HasFormula And idx <> 23 Then
ra1(idx, 1) = ra1(idx, 1) + ra(idx, 1)
End If
Next
wb.Close savechanges:=False
Next sItem
Set wb = Nothing
Set sh = Nothing
Else
End If
End With
'Set the object variable to Nothing.'
Set fd = Nothing
Set wb1 = Nothing
'sh1.Protect ("")'
Application.ScreenUpdating = True
End Sub