How to obtain superscript and mixed font info when read from Excel?

G

gdu

I am reading contents of an Excel file from a VB6 program. I need find
out the superscript and mixed font format info of each cell (such as
"Current Gain (A/cm2)", "Sheet Resistance (W/sq)", that 2 is
superscript and W is Omega in Symbol font). When I use, for example,
Range(strRange).Font.Superscript or Range(strRange).Font.Name, it
returns Null.

Any help will be greatly appreciated.
 
P

Peter T

It's always best to read any Font properties to a Variant as it can accept a
Null in case of mixed formats. Eg

v = cell.font.superscript
If IsNull(v) then ' must be mixed
redim arr(1 to len(cell)) ' could be As boolean for Superscript
for i = 1 to len(cell)
arr(i) = cell.characters(i,1).superscript
etc

Regards,
Peter T
 

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

Top