title: How do I find the upper bound of a nested array?
body: <p>I'm fairly new to VBA, so bear with me.</p>
  
  <p>I have a dynamic array I'm trying to find the upper bound of. I understand how to use UBound to find the upper bound of a 1-d array (i.e. UBound(TestArray)) and to find the upper bound of a 2-d array (i.e. UBound(TestArray,2). What I need to know is if there is a way to find the upper bound of a nested dynamic array.</p>
  
  <p>Basically I have a dynamic array - TestArray(0,j) - where j is a variable and where 0 references a nested dynamic array. I need to know the upper bound for the nested array. Is that possible?</p>
  
  <p>I've tried UBound(TestArray(0,j)()) and UBound(TestArray,1) and they do not work. So what I need is for someone to tell me that one of those should work and it's the rest of my code that's screwed up, that it's not actually possible and I need to start thinking of a work around, or that somewhere, buried fifteen pages into Google search results, someone actually knows how to do this.</p>
  
  <p>BTW, I tried iterating through the array until I reached the end, but obviously after the end the elements don't exist anymore so then I got a "Subscript Out Of Range" error. I'm currently trying to work out the Error Handling on that, but I'm hoping that someone just has a magical solution to my problem that would ideally be about one line of code.</p>