foolishpiano
New Member
- Joined
- Aug 19, 2016
- Messages
- 25
Hello everyone! I'm trying to copy the value from a formula and paste the result as a value only, but when the code is run I receive a #DIV/0! error. The code I have is:
Any ideas on how to fix the error, or why it's occurring?
Thank you all!
Code:
Range("S4").Activate
Selection.Formula = "=average(O15:O500)"
Range("S5").Select
ActiveCell.FormulaR1C1 = "=DATEDIF(R[-1]C,TODAY(),""d"")"
Range("S5").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Any ideas on how to fix the error, or why it's occurring?
Thank you all!