Sau khi tìm kiếm trên mạng em đã sưu tầm được một hàm sau để dùng thay cho hàm Indirect với đối số là mảng động. Em thấy nó đã sử lý được vấn đề. Xin mời các bác tham khảo.
Code:
Public Function DINDIRECT(sName As String) As Range
'It stands for Dynamic Indirect
Dim nName As Name
'Make sure the name supplied exists
On Error Resume Next
Set nName = ActiveWorkbook.Names(sName)
Set nName = ActiveSheet.Names(sName)
On Error GoTo 0
'Set the function to the range or return the name error
If Not nName Is Nothing Then
Set DINDIRECT = nName.RefersToRange
Else
DINDIRECT = CVErr(xlErrName)
End If
End Function
Các bác hãy thay hàm Indirect bàng hàm Dindirect (tất nhiên là phải biết cách đưa một hàm tự tạo vào!)
ví dụ sau đây em đã thử
Code:
Public Function DINDIRECT(sName As String) As Range
'It stands for Dynamic Indirect
Dim nName As Name
'Make sure the name supplied exists
On Error Resume Next
Set nName = ActiveWorkbook.Names(sName)
Set nName = ActiveSheet.Names(sName)
On Error GoTo 0
'Set the function to the range or return the name error
If Not nName Is Nothing Then
Set DINDIRECT = nName.RefersToRange
Else
DINDIRECT = CVErr(xlErrName)
End If
End Function
Các bác hãy thay hàm Indirect bàng hàm Dindirect (tất nhiên là phải biết cách đưa một hàm tự tạo vào!)

ví dụ sau đây em đã thử