How to identify a cell [format|category|number|scientific] for sea

D

delisle_d

I currently have a project in which I need to identify a cell if it is
formatted with scientific and to ignore the data value. Similar to:

If objExcel.Cells(intRow,Column).xxxxx = scientific Then
Else intRow = intRow + 1

Any help would be gretly appreciated

Office --> Excel 2k3 using *.vbs
 
D

Dave Peterson

If I record a macro while I format a cell as Scientific with two decimal places,
I'd get this numberformat:
0.00E+00

And this recorded code.
Selection.NumberFormat = "0.00E+00"

So I could use:

if objExcel.cells(introw,intColumn).numberformat = "0.00E+00" then
'do nothing
else
introw = introw + 1
end if

But I'm not sure if that matches what you need to check for, either. There are
lots of variations of Scientific formatting.

(I wouldn't use a variable named Column in my code, either.)
 
M

Modeste

Bonsour® Dave Peterson avec ferveur ;o))) vous nous disiez :
If I record a macro while I format a cell as Scientific with two
decimal places, I'd get this numberformat:
0.00E+00

And this recorded code.
Selection.NumberFormat = "0.00E+00"

So I could use:

if objExcel.cells(introw,intColumn).numberformat = "0.00E+00" then
'do nothing
else
introw = introw + 1
end if

But I'm not sure if that matches what you need to check for, either.
There are lots of variations of Scientific formatting.

;o)))
if objExcel.cells(introw,intColumn).numberformat Like ("*E+*") then
 

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