Run time error 9: subscript out of range please help me out

ubaig

New Member
Joined
Mar 18, 2014
Messages
17
Code:
ReDim array_values(aheight)
Do Until count = aheight


    'repopulate the first cell
    If IsNumeric(array_fields(count_2 + 1)) Then
        strQuote = vbNullString
    Else
        strQuote = "'"
    End If
    cell = strQuote & esc(array_fields(count_2)) & strQuote


    'Populate the cell value
     Do Until count_3 = aWidth
     If isNumeric(array_fields(count_2, (count_2 + 1))) Then ----> subscript error here 
            strQuote = vbNullString
        Else
            strQuote = "'"
        End If
        cell_2 = cell_2 & ", " & strQuote & esc(array_fields(count_2, (count_3 + 1))) & strQuote
        count_3 = count_3 + 1
     Loop
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Put the array_fields in Watch window and try to see the values of every element of array. You might find something úseful. Thats how I debug with arrays when I get Subscript Out of Range Error.
 
Upvote 0

Forum statistics

Threads
1,223,277
Messages
6,171,156
Members
452,385
Latest member
Dottj

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