Write VBA to Ignore Error in Excel

  • Thread starter Thread starter March
  • Start date Start date
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
 
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.
 
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.
 
Back
Top