Get cell's number format category in VBA?
I don't think we can get it directly (because catagory is not a property of
the range object). However code can be written to figure it out.
For example, if the format has a % in it it must be Percent; if the format
has a $ in it it must be Currency; etc.
Need to determine some key characters and then do some kind of lookup.
Good Luck
--
Gary''s Student - gsnu200785
"dyowee" wrote:
This returns the actual number format, not the category, like 'General',
'Percentage', 'Currency', etc...
"Gary''s Student" wrote:
Sub whatformat()
MsgBox (ActiveCell.NumberFormat)
End Sub
--
Gary''s Student - gsnu200785
|