Como cargar datos de otro libro de excel
Cuento con la hoja "RedDia" que le pertenece al libro "01.Reportes.xlsm"
La cual carga datos de dos hojas que le corresponden al libro "00.Data.xlsm", las cuales son "SAP" y "GMT"
Usando el siguiente código
Sub RepDia()
Dim Fecha, i, TotProd, TotDevo, x, pCol, pLin, TotDesp
pCol = Workbooks("01.Reportes.xlsm").Worksheets("DepDia").Cells(1, 2) + 1
BorrarRepDia
With Workbooks("00.Data.xlsm").Worksheets("SAP")
TotDesp = 0
For pLin = 6 To 36
Fecha = Workbooks("01.Reportes.xlsm").Worksheets("DepDia").Cells(pLin, 1)
TotProd = 0
TotDevo = 0
For x = 6 To 23 Step 2
Prod = Workbooks("00.Data.xlsm").Worksheets("TProductos").Cells(pCol, x)
If Prod <> "" Then
TotProd = TotProd + (Application.WorksheetFunction.SumIfs(.Range("dbSAP[Cantidad UG6]"), .Range("dbSAP[Clase de entrega]"), "<>ZDEV", .Range("dbSAP[Fe.mov.mcía.real]"), Fecha, .Range("dbSAP[Producto]"), Prod) * Workbooks("00.Data.xlsm").Worksheets("TProductos").Cells(pCol, x + 1))
TotDevo = TotDevo + (Application.WorksheetFunction.SumIfs(.Range("dbSAP[Cantidad UG6]"), .Range("dbSAP[Clase de entrega]"), "ZDEV", .Range("dbSAP[Fe.mov.mcía.real]"), Fecha, .Range("dbSAP[Producto]"), Prod) * Workbooks("00.Data.xlsm").Worksheets("TProductos").Cells(pCol, x + 1))
End If
Next
If TotProd > 0 Then
Workbooks("01.Reportes.xlsm").Worksheets("DepDia").Cells(pLin, 2) = TotProd - TotDevo
End If
TotDesp = Application.WorksheetFunction.SumIfs(Workbooks("00.Data.xlsm").Worksheets("GMT").Range(Workbooks("00.Data.xlsm").Worksheets("GMT").Cells(5, pCol + 14), Workbooks("00.DataE.xlsm").Worksheets("GMT").Cells(371, pCol + 14)), Workbooks("00.DataE.xlsm").Worksheets("GMT").Range(Workbooks("00.DataE.xlsm").Worksheets("GMT").Cells(5, 1), Workbooks("00.DataE.xlsm").Worksheets("GMT").Cells(371, 1)), Fecha)
If TotDesp > 0 Then
Workbooks("01.ReportesE.xlsm").Worksheets("DepDia").Cells(pLin, 3) = TotDesp
End If
Next
End With
End SubSin embargo la hoja de origen en el cual se ingresaban medida, fue modificada, y ahora usa un formato diferente al anterior

Hoja Actual

Ahora se requiere cargue los datos utilizando otro tipo de medida usado en esta nueva tabla