What is the difference between .text, .value, and .value2?

Chris picture Chris · Jun 28, 2013 · Viewed 234.4k times · Source

What is the difference between .text, .value, and .value2? Such as when should target.text, target.value, and target.value2 be used?

Answer

Charles Williams picture Charles Williams · Jun 28, 2013

.Text gives you a string representing what is displayed on the screen for the cell. Using .Text is usually a bad idea because you could get ####

.Value2 gives you the underlying value of the cell (could be empty, string, error, number (double) or boolean)

.Value gives you the same as .Value2 except if the cell was formatted as currency or date it gives you a VBA currency (which may truncate decimal places) or VBA date.

Using .Value or .Text is usually a bad idea because you may not get the real value from the cell, and they are slower than .Value2

For a more extensive discussion see my Text vs Value vs Value2