UBound and LBound for Arrays

Results 1 to 2 of 2

Thread: UBound and LBound for Arrays

  1. #1
    Join Date
    Dec 1969
    Posts
    511

    Default UBound and LBound for Arrays

    Ok, can any one tell me why this is given error, according to MS docs this should work fine!?!<BR><BR>Function GetNextFree<BR> GetNextFree = -1<BR> For x = LBound(EquipList) to UBound(EquipList,1)<BR> If EquipList(x,0) = 0 Then<BR> GetNextFree = x<BR> Exit For<BR> End If<BR> Next<BR>End Function <BR><BR>I&#039m getting this error :<BR><BR>800a000d<BR>Type mismatch: "LBound"<BR><BR>Cheers<BR><BR>Pete

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default false alarm, I've sorted it now...

    I was not declaring the array before I called the function that referenced it. Doh!<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •