Chào các bạn mình có đoạn code như thế này
Tổng có 50 file không thể nào ngồi viết lại như thế được rất mệt, các bạn có cách nào tối ưu dùm mình nhé. Cảm ơn các bạn đã đọc bài và giúp đỡ.Sub BA() With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\3.XLS"
End With
End Sub
Sub BON()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\4.XLS"
End With
End Sub
Sub NAM()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\5.XLS"
End With
End Sub
Sub SAU()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\6.XLS"
End With
End Sub
Sub BAY()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\7.XLS"
End With
End Sub
Sub TAM()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\8.XLS"
End With
End Sub
Sub CHIN()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\9.XLS"
End With
End Sub
Sub MUOI()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\10.XLS"
End With
End Sub
Sub M_MOT()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\11.XLS"
End With
End Sub
Sub M_HAI()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\12.XLS"
End With
End Sub
Sub M_BA()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\13.XLS"
End With
End Sub
Sub M_BON()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\14.XLS"
End With
End Sub
Sub M_NAM()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\15.XLS"
End With
End Sub
Sub M_SAU()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\16.XLS"
End With
End Sub
Sub M_BAY()
With CreateObject("Shell.Application")
.Open ThisWorkbook.Path & "\17.XLS"
End With
End Sub