title: Excel Vba, load picture from folder
body: <p>I'm trying a macro to load a picture from a folder with the name of the cell value.</p>
  
  <p>So
  Value:
  Q2 = Where is the dog
  then i want to load the picture 'Where is the dog.jpg'
  in cells c2:E2</p>
  
  <p>The value of cell Q2 changes when a other macro is runs.</p>
  
  <p>I have some blackout here, because cann't get it working.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>       Set PicRange = Sheet1.Range("C2:E14")
  
  
         Filepath = "C:\Pictures\"
         Filename = Filepath &amp; Sheet1.Range("Q2").Value &amp; ".jpg"
  
          If Dir(Filename) = "" Then MsgBox "Nothing!"
          Exit Sub
  
          With PicRange
              Set Pic = Sheet1.Shapes.AddPicture(Filename, msoFalse, msoTrue, .Left, .Top, .Columns.Width, .Rows.Height)
  
          End With
  </code></pre>
  
  <p>The picture will not display</p>