You can use the NumberFormat Property of Cells Collection (which you can
reference as a collection or individual value by specifying an index
Cells("A1")) to get/set the format:
Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)" 'Accounting
Selection.NumberFormat = "0.00" 'Number
You can use the Formula property to Get/Set a Formula:
Remember that the defualt sytle for most installs if excel generates the
formula is R1C1 Format, so you can use ActiveCell.Formula =
"=SUM(R[-2]C:R[-1]C)"
Cells("A1").Formula = "=SUM(R[-2]C:R[-1]C)"
Cells("A1:A6").Formula = "=SUM(R[-2]C:R[-1]C)"
etc
If you don't know of something that you want to do and you are in office,
you can always 'cheat' and record a macro, then do what you are trying to
figure out how to do via the UI. Then you can go to the Visual Basic Editor
and see what's happened. It'll write a bunch of junk code, but you can get
a good feel for what you need to do or what specific object properties you
are looking for.
HTH,
Bill
Gunalan said:
Hi,
Can u help me to Extract Excel Cell Properties like Formula Functions
and Data Type like Numeric,Accounting etc..