Write VBA to Ignore Error in Excel

M

March

Dear All,

I would like to know how to write VBA to Ignore Error in MS Excel.

I have written VBA in MS Access to copy and paste in Excel. For example,
A1 = 1000, B1 = 100 and C1 = A1/B1. My copy/paste code works well, however,
in cell C1 shows the cell contains error.

Normally in Excel, when right click on dropdown list and click on "Ignore
Error", the error in Excel is gone.

Please give me suggestion.


Thanks,
March
 
M

Maurice

it's better to catch the error and handle it but most of the times you'll
find:

On error resume next

as the line that ignores the error.
 
J

Jellifish

Don't hide errors - fix them!

C1 = IF(B1=0,0,A1/B1)

The above formula will return a zero where the value in B1 is zero. This
prevents the divide by zero error.
 

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