title: Resize and change the format of multiple pictures using Excel VBA
body: <p>I have an excel worksheet with a lot of pictures with various sizes and formats.  I want to use excel VBA to loop through all the pictures in the worksheet, and set each picture to the same width (214) and change the picture type to a JPEG after resizing (to keep the file size down).  My pictures are located in various cells, and I don't want the picture locations to change (i.e. stay in the same cell).  I'm new to VBA and tried the following - but it doesn't work.  The debugger stops at the line where I'm trying to cut the picture.  </p>
  
  <pre><code>Sub Macro6()
  
  Dim p As Object
  
  Dim iCnt As Integer
  
      For Each p In ActiveSheet.Shapes
          p.Width = 217.44
          p.Cut
          p.PasteSpecial Format:="Picture (JPEG)", Link:=False
          iCnt = iCnt + 1
      Next p
  End Sub
  </code></pre>