Hello,
Can anyone fix this 1 line of code?
ActiveCell.FormulaR1C1 = "=Sum('C:\Temp\\[" & Format(Now - 1, "mm-dd-yy") & "]\Report" & Format(Now - 1, "mm-dd-yy")Shadow'!R11C6"
Thank you for any feedback!
Printable View
Hello,
Can anyone fix this 1 line of code?
ActiveCell.FormulaR1C1 = "=Sum('C:\Temp\\[" & Format(Now - 1, "mm-dd-yy") & "]\Report" & Format(Now - 1, "mm-dd-yy")Shadow'!R11C6"
Thank you for any feedback!
Try this:
Basically I'm replacing the Now - 1 with a DateAdd("d", -1, Now), and adding a '& "' that was missing...Code:ActiveCell.FormulaR1C1 = "=Sum('C:\Temp\\[" & Format(DateAdd("d", -1, Now), "mm-dd-yy") & "]\Report" & Format(DateAdd("d", -1, Now), "mm-dd-yy") & "Shadow'!R11C6"
I haven't tested this, though it should work fine...
Hope this helps.
Michael