Reputation: 103
I'm trying to loop code from cell directly in a macro. But all the return values in the AD column are #NAME?
. How can I fix this?
Note that my Column refer to K-Column
which has Date value in a form like this: 24/6/2015 6:54:00 AM
for example.
For PRow = lrow To 2 Step -1
CurrentSheet.Cells(PRow, "AD").Value = "=CONCATENATE(YEAR(R[0]C[-19]), _
""/"",TEXT(MONTH(R[0]C[-19]),""00""))"
Next PRow
Upvotes: 0
Views: 84
Reputation: 2551
When using the R[]C[] Notation you need to add the value like this:
CurrentSheet.Cells(PRow, "AD").FormulaR1C1 = "=CONCATENATE(YEAR(R[0]C[-19]), ""/"",TEXT(MONTH(R[0]C[-19]),""MM""))"
Upvotes: 2