PDA

View Full Version : Solved: Get values from cell with VBA



dandilo
03-10-2009, 05:13 AM
Hello Guys,

I would like to know how can I get values from cell with VBA?

But I want to get this values formatted:

E.g -> Real Value: A1= 556.6655632+E16 -> Formatted: A1=566.66

I'm able to get the real value (556.6655632+E16) with VBA, but I would want to get the formatted value with VBA.

Anyone knows how can I do it? :help

Bob Phillips
03-10-2009, 05:23 AM
myVar = Format(Range("A1").Value, "#,##0.00")


or if the cell is alfready formatted



myVar = Range("A1").Text

dandilo
03-10-2009, 06:28 AM
Thanks xld, it work!

mdmackillop
03-10-2009, 10:49 AM
Hi dandilo,
You can mark your thread Solved using the Thread Tools dropdown.
Regards
MD