title: PictureLookup macro stopped locating portrait pictures properly
body: <p>I have a PictureLookup macro set up to show over a hundred pictures. Did my tests and it was all working fine, but I had too many of them stacking on top of themselves (recalculated, removed the deletion part because it caused problems). After that, the portrait ones are added far to the right... Any idea what's going on here? </p>
  
  <pre><code>Public Function PictureLookup(Value As String, Location As Range)
  
  Application.Volatile
  
  Dim lookupPicture As Shape
  Dim sheetName As String
  Dim picTop As Double
  Dim picLeft As Double
  
  sheetName = Location.Parent.Name
  
  'Delete current picture if exists
  'For Each lookupPicture In Sheets(sheetName).Shapes
  '    If lookupPicture.Name = "PictureLookup" Then
  '        lookupPicture.Delete
  '    End If
  'Next lookupPicture
  '
  'Get position of cell calling the UDF
  picTop = Location.Top
  picLeft = Location.Left
  
  'Add the picture in the right location
  Set lookupPicture = Sheets(sheetName).Shapes.AddPicture _
  ("F:\DCIM\1000GRMN\DSC00" &amp; Value &amp; ".jpg", msoFalse, msoTrue, picLeft, picTop, -1, -1)
  
  'change the picture name
  lookupPicture.Name = "PictureLookup"
  lookupPicture.Height = 100
  PictureLookup = ""
  
  End Function
  </code></pre>
  
  <p>They are supposed to show in the higlighted column Q : 
  <a href="https://imgur.com/a/RNn735d" rel="nofollow noreferrer">https://imgur.com/a/RNn735d</a></p>
  
  <p>Formula is written :
  <code>=PictureLookup(Q2;Q2)</code> 
  <code>=PictureLookup(Q3;Q3)</code>
  etc </p>