Range("C7").FormulaR1C1 = _
"=SUMIFS('Date '!C4,'Date '!C1,R3C3,'Date '!C2,R4C3,'Date '!C3,Sheet2!RC[-1])"
Range("C8").FormulaR1C1 = _
"=SUMIFS('Date '!C4,'Date '!C1,R3C3,'Date '!C2,R4C3,'Date '!C3,Sheet2!RC[-1])"
Range("C9").FormulaR1C1 = _
"=SUMIFS('Date '!C4,'Date '!C1,R3C3,'Date '!C2,R4C3,'Date '!C3,Sheet2!RC[-1])"
Range("C10").FormulaR1C1 = _
"=SUMIFS('Date '!C4,'Date '!C1,R3C3,'Date '!C2,R4C3,'Date '!C3,Sheet2!RC[-1])"
Range("C11").FormulaR1C1 = _
"=SUMIFS('Date '!C4,'Date '!C1,R3C3,'Date '!C2,R4C3,'Date '!C3,Sheet2!RC[-1])"
Deepak ,
thanks for your help , i have problem in implementing the code in my file , when i rum the macro give me open window then give me #VALUE! .
can you help me with this
Dear ,
i appreciate your help i have other thing what i have to add to my code to make the data change automaticly whrn change the name without nedd to run the macro each time i change the name .
Thanks
Dear ,
attached the file i have problem with . is the problem the sheet name "data " how i can solve it if i have the same problem in other sheets .
other thing could you help me with i add total so i want the code take the cells before the total and after the total and not take the total cell ,
Thanks alot for your help
Sub test()
With Sheet2
.[c7:c11] = "=IF(B7<>""Total"",SUMIFS(Data!$D:$D,Data!$A:$A,$C$3,Data!$B:$B,$C$4,Data!$C:$C,B7),SUMIF($B$6:$B6,""<>""""Total"",$C$6:C6))"
.[c7:c11].Value = .[c7:c11].Value
End With
End Sub