Premature exit from Sub

mwc0914

New Member
Joined
Sep 24, 2015
Messages
42
Does anyone know what can cause the logic to just exit a called Sub without any condition?
The Sub is running, then boom, it exits...no IF/WHEN condition, no Exit statement...nada
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I'm having the same problem. Here's a sample from the code:

Sub GetIMdata(ByRef webpage As Variant)

Select Case webpage(9, 2)
Case "TO BE SET", "PENDING REVIEW", "PENDING", "INTERSTATE"
IM_data(eos) = "1/1/1900"
Case "SENTENCED TO LIFE"
IM_data(eos) = "12/31/9999"
Case Else
IM_data(eos) = webpage(2, 9)
End Select


i = 999
End Sub

The array IM_data() is a public variable. The subr was working when I passed it a worksheet, but I changed it to an array to increase speed.

The statement ( IM_data(eos) = webpage(2, 9)) never gets executed.

I have another section that loops through the array using for...nexts that does the same thing.
thanks
 
Upvote 0
I found it - " webpage(2, 9)" - outside the bounds of the array
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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