Hi all:
I have excel file with sheet(result") and alot of sheets("ABCxxxxxxxx") with xxxxxxxx is number, the number of sheets("ABCxxxxxxxx") dynamic
Now I want to fill in some fomula from column E to last column that row(1) have data by macro with conditions that:
https://imgur.com/a/JqMaMbX
All Fomula that I need look like the image I attach, please help me. Many thanks./.
I have excel file with sheet(result") and alot of sheets("ABCxxxxxxxx") with xxxxxxxx is number, the number of sheets("ABCxxxxxxxx") dynamic
Now I want to fill in some fomula from column E to last column that row(1) have data by macro with conditions that:
Code:
Each Cell(1,i) in range(cells(1,5),cells(1,lastcolumn)), i = 5 to lastcolumn
if Cells(1,i).Value = right(sheets(j).name,8).Value then
Cells(5,i).fomula =+SUMIF(sheets(j)!$B$2:$B$1931;"R-2110";sheets(j)!$K$2:$K$1931)+SUMIF(sheets(j)!$B$2:$B$1931;"R-2110";sheets(j)!$O$2:$O$1931)
Cells(6,i).fomula =+SUMIF(sheets(j)!$B$2:$B$1931;"R-1213";sheets(j)!$K$2:$K$1931)
End if
Next cells
https://imgur.com/a/JqMaMbX
All Fomula that I need look like the image I attach, please help me. Many thanks./.