Hey guys,
I have created this huge R1C1 formula and now I need to create a variable for the sheets names (NO1) and for the love of me I just simply can't. It works for the first INDIRECT, but for e.g. MATCH or FIND, it doesn't. Any ideas?
ActiveCell.FormulaR1C1 = "=SUM(INDIRECT(""" & basicsh & "!"" & MID(ADDRESS(13,MATCH(" & ThirdSheet & "!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),1)+1,1) & ROW(INDIRECT(MID(ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),1)+1,1) & MATCH(Copy!R[-1]C24,NO1!C[-14],0),TRUE)),TRUE):INDIRECT(""NO1!"" & MID(ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C200,0)),1)+1,1) & ROW(INDIRECT(MID(ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:C20,0)),1)+1,1) & MATCH(Copy!R[-1]C24,NO1!C[-14],0),TRUE))+COUNTIF(NO1!C[-14],Copy!R[-1]C24)-1,TRUE))"
Thanks and regards,
piopl
I have created this huge R1C1 formula and now I need to create a variable for the sheets names (NO1) and for the love of me I just simply can't. It works for the first INDIRECT, but for e.g. MATCH or FIND, it doesn't. Any ideas?
ActiveCell.FormulaR1C1 = "=SUM(INDIRECT(""" & basicsh & "!"" & MID(ADDRESS(13,MATCH(" & ThirdSheet & "!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),1)+1,1) & ROW(INDIRECT(MID(ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),1)+1,1) & MATCH(Copy!R[-1]C24,NO1!C[-14],0),TRUE)),TRUE):INDIRECT(""NO1!"" & MID(ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C200,0)),1)+1,1) & ROW(INDIRECT(MID(ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:R13C20,0)),FIND(""$"",ADDRESS(13,MATCH(NO1!R1C7,NO1!R13C1:C20,0)),1)+1,1) & MATCH(Copy!R[-1]C24,NO1!C[-14],0),TRUE))+COUNTIF(NO1!C[-14],Copy!R[-1]C24)-1,TRUE))"
Thanks and regards,
piopl