help again...

help again...wat does subscript out of range mean???help me please......


  • It occurs mostly in arrays when you declare the array to hold 'n' elements but try to retrieve n+1 element

    For example

    Sub FillArray()

    Dim Array2D(1 To 2, 1 To 2) As String

    Array2D(1, 1) = "One and One"
    Array2D(1, 2) = "One and Two"
    Array2D(1, 3) = "Error "
    Array2D(2, 1) = "Two and One"
    Array2D(2, 2) = "Two and Two"

    End Sub

    Array2D(1, 3) throws an error as the array is (2,2) one and the third element doesn't exist

    VBA Tips & Tricks ([link=][/link])

    C# Code Snippets ([][/link])
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion