Hi,
I am having issues using the formulaR1C1 property. Actually, I haven't been able to figure out how to use variables inside of this property to refer to cells.
What I am trying to accomplish is the following:
I have data arranged by date in columns and a key index in rows. For a user specified week end date, I want to calculate the average for a week's worth of data.
Using the user specified date, I search for the date in the column headings and save the column number in a variable temp.
How can I use temp inside the formulaR1C1 property? I also couldnt understand how to use the Formula property.
Here is the code
I get error 1004 application defined or object defined error.
I am having issues using the formulaR1C1 property. Actually, I haven't been able to figure out how to use variables inside of this property to refer to cells.
What I am trying to accomplish is the following:
I have data arranged by date in columns and a key index in rows. For a user specified week end date, I want to calculate the average for a week's worth of data.
Using the user specified date, I search for the date in the column headings and save the column number in a variable temp.
How can I use temp inside the formulaR1C1 property? I also couldnt understand how to use the Formula property.
Here is the code
Rich (BB code):
With temp_file.Sheets("Fwd_SBEVM_MB")
.Cells(3, 33).FormulaR1C1 = "=AVERAGE(RC[33-temp-6]:RC[33-temp]"
End With
I get error 1004 application defined or object defined error.