cells.value vs cells.formula

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,559
Hi
In this code, I do not see any difference between cell.value and cells.formula when it comes to entering a formula.
They both did the same thing. Am I right? Is there any case, I have to use cells.formula instead of cells.value? Thank you very much.

Code:
Sub insert_formula()
    Cells(11, 1).Value = "=sum(a1:a10)"
    Cells(12, 1).Formula = "=sum(a1:a10)"
End Sub
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,764
Office Version
365
Platform
Windows
They both work like that, however I would always use Formula when entering a formula & Value when entering a value, as I find it far more obvious what is going on, when revisiting the code at some point in the future.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,764
Office Version
365
Platform
Windows
Another point, if you use .Formula & in 2 years someone asks you to change the formula, you can search for .Formula & quickly find the formula to change.
Whereas if you use .Value it will take a lot longer.
 

Watch MrExcel Video

Forum statistics

Threads
1,089,742
Messages
5,410,162
Members
403,301
Latest member
Excel_Trainee

This Week's Hot Topics

Top