Out of the several worksheets I am having, I retrieve one particular sheet name based on a fixed pattern and store it in a variable. Subsequently, I want to use this variable in the Fill Range activity wherein the SUMIF formula is being used.
=SUMIF('sheet_name'!A:A,C2,'sheet_name'!R:R)")
But this is not working as the variable value is not getting used in place of sheet_name. I have verified that the variable is properly assigned outside this activity.
This approach is working partially i.e., the sheet name variable is appearing in the formula but I am still facing an error -
The data you want to write "=SUMIF("Sheet-Work" !A:A,C2, "Sheet-Work" !R:R)" has a wrong format.
I entered it as "=SUMIF(""" + sheet_name + """ !A:A,C2, """ + sheet_name + """ !R:R)"
The error box would not have appeared if Sheet-Work gets enclosed in single quotes. I tried different combinations like adding the single quote inside/outside the double quote combination.