title: vba excel get picture's bottom row
body: <p>I have a spreadsheet with a picture. I don't know the size of the picture (it may vary).
  I want to to get the last row of the picture in a variable (I want to leave a blank row to the bottom of the picture and start filling data in the next row). Could you help me figure out the syntax?</p>
  
  <p>I can't even figure out how to get the picture into a variable..</p>
  
  <p>I was able to do this with the following code:</p>
  
  <pre><code> Dim testPic As Object
   For Each testPic In ActiveSheet.Pictures
      h = testPic.Height
      cellHeight = Cells(ImageTopRow, ImageLeftCol).Height
      nRows = h/cellHeight
   Next
  </code></pre>
  
  <p>But:
  a. I don't need a foreach, there's only one picture in the collection, I just can't figure out how to get the first one.
  b. There should be an easier way, right?</p>
  
  <p>Thanks,
  Li</p>