Option Explicit
Sub CopySheet()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim aSheet(), book As Workbook, sheet As Worksheet, count
Dim bookName As String, bookNew As Workbook, rValueTuyChinh As Range
Set book = ThisWorkbook
For Each sheet In book.Worksheets
If sheet.Name <> "Main" And sheet.Name <> "Gimick" Then
count = count + 1
ReDim Preserve aSheet(1 To count)
aSheet(count) = sheet.Name
End If
Next sheet
book.Worksheets(aSheet).Copy
bookName = book .Path & "\" & Format(Now, "yyyyMMdd_hhmmss") & ".xlsx"
Set bookNew = ActiveWorkbook
With bookNew
For count = 1 To .Worksheets.count
Set sheet = .Worksheets(count)
If sheet.Name = "Don dat hang" Then
Set rValueTuyChinh = sheet.Range("O1:R100")
rValueTuyChinh.Value = rValueTuyChinh.Value
End If
Next count
.SaveAs bookName, FileFormat:=xlOpenXMLWorkbook
.Activate
'.Close False
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub