Run-Time error not showing up in Debug

cbarton

New Member
Joined
Aug 20, 2004
Messages
5
Hola,
I've got a pretty long macro that throws a Run-Time Error when ran, but does not error out when I debug and step in the code. I've got lots of cell value evaluations and its probably a Null value causing it, but I need a way to confirm. I'm about to create a log worksheet and just write to it after each section of my code, unless someone has a better idea. Thanks in advance.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Just added Log worksheet and wrote to it and found my code that was causing an error. I'd like to find out what I did wrong so I can avoid the issue in the future. The line was:

If i.Range("AB" & j).Value <> "" Then

This is part of a loop and it would run through 86 records and then error out. I checked the value of this specific record and there is nothing different than any records before or after it. Could this be caused by a cell formatting issue? I replaced all the Null values in Column AB with XX and changed code to:
If i.Range("AB" & j).Value <> "XX" Then

...and then it ran fine. Where is my mistake?
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top