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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top