I was wondering why, in VBA code for Excel 2003, we even need to use Range.Formula to write a formula for a cell instead of just using Range.Cell ? They both write the lines in a cell that becomes a forum, and this formula works (from what I tested).
ActiveCell.Value="=If(True,""yes"",""no"")"
and
ActiveCell.Formula="=If(True,""yes"",""no"")"
do the same for me (when I select a cell and execute each of the above code segments separately in separate cells). Both of them show a yes value in the cell, and the formula is saved when I click to view each cell.
I looked at the Microsoft Dev Center for information:
Range.Formula property for Excel 2013 (Excel 2003 did not have a page for this property)
Range.Value Property for Excel 2003 (Expand the value of the Value property applicable to the Range object.)
I also googled βWhy use Range.Formula instead of Range.Value VBA Excelβ and could not find anything related to my question.
Some people said use Range.Value .
Some say use Range.Formula when stack overflows (Sorry, I lost the link to the exact question ...)
source share