I have tried several VBA macros from the Internet, but I have not found a solution.
Folder C:\Temp\ contains images (about 1500 files, different width and height. All files are named different format name)
example: 1.jpg, 2.jpg, 3.jpg, 4.jpg, 4A.jpg, 5blok.jpg .... .etc to 1500.jpg
In the column "D" I have a image name
example:
D2 = 10
D3 = 7blok
D8 = 25
etc.
I want into cells B2, B3, B8, etc. insert images based on image name in column "D". (Only in the row containing the image name in the "D". If a cell in column D is empty, then the cells in the same row in column B should be empty)
My problem is the following:
- After starting the VBA Excel should insert images into column "B" based on their names in column "D" (but only to the row that contains the image name in the "D")
- Some images are dimensions: 154x75, 272x104, 96x150, 150x118 etc. I want to VBA all images that are wider than 100 pix reduced to 100 pixels, and the images that are less than 100 pix leave the respective width. I want set maximum image width is 100 pix (width of column B). The images height should be adjusted (adapt) to a given width. So, should keep the ratio width/height
- Finally, in each row in which the inserted picture Excel should adjust (adapt) the height row for that picture.
- When I delete files in the Temp folder, Excel needs to keep all of the images inside Workbook
I hope you understand. If you need, I will be further clarified.
Note! I use non-US Excel settings
Can someone help?
Folder C:\Temp\ contains images (about 1500 files, different width and height. All files are named different format name)
example: 1.jpg, 2.jpg, 3.jpg, 4.jpg, 4A.jpg, 5blok.jpg .... .etc to 1500.jpg
In the column "D" I have a image name
example:
D2 = 10
D3 = 7blok
D8 = 25
etc.
I want into cells B2, B3, B8, etc. insert images based on image name in column "D". (Only in the row containing the image name in the "D". If a cell in column D is empty, then the cells in the same row in column B should be empty)
My problem is the following:
- After starting the VBA Excel should insert images into column "B" based on their names in column "D" (but only to the row that contains the image name in the "D")
- Some images are dimensions: 154x75, 272x104, 96x150, 150x118 etc. I want to VBA all images that are wider than 100 pix reduced to 100 pixels, and the images that are less than 100 pix leave the respective width. I want set maximum image width is 100 pix (width of column B). The images height should be adjusted (adapt) to a given width. So, should keep the ratio width/height
- Finally, in each row in which the inserted picture Excel should adjust (adapt) the height row for that picture.
- When I delete files in the Temp folder, Excel needs to keep all of the images inside Workbook
I hope you understand. If you need, I will be further clarified.
Note! I use non-US Excel settings
Can someone help?