How to use function CELL(Infotyp;Ref) in VBA?

S

Stefan Jauch

Hi.

I try to use the worksheet function CELL(Infotyp;Ref) in VBA to abtain the
format info of a cell. But in VBA I can't find this function (it is not
included in the Application.WorksheetFunction object!)

How can I use CELL(..) in VBA?

Is there any other way to obatin the format info that is given by
CELL("Format", ...), i.e. "S" for standard, "F2" for "0,00", "P0" for "0%"
and so on...)?

Thanks in advance,
Stefan Jauch
 
T

Tom Ogilvy

Not all worksheetfunctions are available in VBA. This appears to be one of
them.

Nothing else produces those categorizations. You can use
sFormat = ActiveCell.Numberformat

then parse the results to make your own determination.
 
N

NickHK

Stefan,
Not sure if this is the reason, the Help states:
<quote>
Remarks
The CELL function is provided for compatibility with other spreadsheet
programs.
</quote>
May be this means that it's not part of the object model.

NickHK
 
Top