КОМЕНТАРІ •

  • @hoangminh8466
    @hoangminh8466 7 місяців тому +1

    This works for me. Thank you very much.

  • @xaist6085
    @xaist6085 Місяць тому

    Thank you, helped so much today.
    Was it possible to grab images from a subfolder in the folder we selected?

  • @shadow_gaming_sk
    @shadow_gaming_sk Рік тому

    Excellent video

  • @MohAboAbdo
    @MohAboAbdo Рік тому

    Thank you so much, Sir.

  • @palladiumlab
    @palladiumlab Місяць тому

    Hi very helpfull thanks>
    how to add pictures 'in' cell instead of 'over' the cell?
    also how to just get the name of the file without the extension
    thanks in advance.

    • @ExcelMacroMania
      @ExcelMacroMania Місяць тому

      You cannot get "in" cell because pictures are shapes that are always over the elements of the worksheet. However, the video explains how to fit the picture within the cell borders.

  • @palladiumlab
    @palladiumlab Місяць тому

    very nice.
    how do we make all pictures which we have uploaded 'in' cell instead of 'over' cell.
    also how to just get name of the image without the extension .
    Thanks in advance

    • @ExcelMacroMania
      @ExcelMacroMania Місяць тому

      I already replied to this question above.

  • @KyleAnderson2301
    @KyleAnderson2301 5 місяців тому

    How would I have only certain images inserted from the file folder selected?

    • @ExcelMacroMania
      @ExcelMacroMania 5 місяців тому

      One way is to add the list of names of those images that you want to add in a range maybe in other worksheet, and then add a condition inside the Do loop to check if the file has that name. You can check that adding another loop through the list of names (in the range or put into an array), or putting all of them into a string with Join and check if the file name is there with InStr. For that last option it would look like:
      If InStr(MyFile, TargetFiles) > 0 Then 'insert image
      where the TargetFiles string could be built with Join, for example for 10 image names in range A1:A10:
      TargetFiles = Join(Application.Transpose(Sheet2.Range("A1:A10").Value), ",")
      Another possibility is having the full name with path for the images you want to add and loop through the list while simply insert one a time. This way it doesn't matter if they are in the same folder or not, as long as you provide the path/folder info.

  • @megapower3239
    @megapower3239 8 місяців тому

    how can we make the width of the pictures bigger?

    • @ExcelMacroMania
      @ExcelMacroMania 8 місяців тому

      The picture fits the size of the cell. That's why we set the row height and then get the size first with properties Left, Top, Width, and Height. You can also set the column width of the cell before adding the picture with Cells(r, 2).ColumnWidth = 10 for example. If you want to change the width of the picture without changing the width of the cell (the picture will overflow the cell), you need to assign the picture to an object variable (Set pic = ActiveSheet.Shapes.AddPicture(myPic,msoFalse, msoTrue,x,y,....) and then modify the width with pic.Width = 200