Chirag R Raval
Member
Dear All Experts,
I can not copy sumproduct array formula from one columns to many columns.
below is screen shot for the same with requirement
my code of array formula of first column is below
Column "B of above range is absolute reference for all cell's formula because all values of all columns based on column b's critera
but how can make dynamic that column b is absolute but next all columns
formula take as relative at right side when copy same in right
hope your help please..
Regards,
Chirag Raval
Hope there are some way
I can not copy sumproduct array formula from one columns to many columns.
below is screen shot for the same with requirement
my code of array formula of first column is below
Code:
Dim lookmycol As Range
Dim qtycol As Range
Dim threeblk As Range
Dim raja As Variant
Set qtycol = ActiveSheet.Range("E2", ActiveSheet.Range("E2").End(xlDown))
Set lookmycol = qtycol.Offset(0, -3)
Set threeblk = rng2.Range("B1:B3")
raja = Application.WorksheetFunction.Sum(threeblk)
'Set valcol = qtycol.Offset(0, 1)
'JUST EXAMPLE-my2ndrng.Cells(1, 2).Formula = "=SUM(SUMIFS(sum_range,criteria_range,{" * red * "," * blue * "}))"
'EXAMPLE-2 qtycol.End(xlDown).Offset(7, 0).Formula = "=SUMPRODUCT(SUMIFS(" & qtycol.address + "," & lookmycol.address & ",{" & Chr(34) & "*TRS*Total*" & Chr(34) & "," & Chr(34) & "*CUTS*Total*" & Chr(34) & "}))"
'SUM & SUMIFS & SUMPRODUCTS ON END OF COLUMN OF RANGE 2 QTY COLUMN
rng2.Cells(1, 2).Formula = "=SUMPRODUCT(SUMIFS(" & qtycol.address & "," & lookmycol.address & ",{" & Chr(34) & "*TRS*Total*" & Chr(34) & "}))"
rng2.Cells(2, 2).Formula = "=SUMPRODUCT(SUMIFS(" & qtycol.address + "," & lookmycol.address & ",{" & Chr(34) & "*MBO*Total*" & Chr(34) & "}))"
rng2.Cells(3, 2).Formula = "=SUMPRODUCT(SUMIFS(" & qtycol.address + "," & lookmycol.address & ",{" & Chr(34) & "*whs*Total*" & Chr(34) & "}))"
rng2.Cells(4, 2).Value = Application.WorksheetFunction.Sum(rng2.Range("B1:B3"))
rng2.Columns(2).Copy
rng2.Range("C:M").Paste
Column "B of above range is absolute reference for all cell's formula because all values of all columns based on column b's critera
but how can make dynamic that column b is absolute but next all columns
formula take as relative at right side when copy same in right
hope your help please..
Regards,
Chirag Raval
Hope there are some way