Macro to copy a variable number of pictures from one file to another.

Cuprian

New Member
Joined
Oct 25, 2021
Messages
20
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello,

I want to write a macro that will search for a cell with string "Items-Description" (which can be at different rows in each file) and from that row it will copy all the pictures in column E that occur before the cell with a string "Items-Details". Then it will paste those pictures in new excel file in specific sheet. Do you have any tips/functions I can use?

1666170310087.png


MR_Excel_example.xlsx
ABCDEFGH
1defXxx
2effwff
3fwffwf
4fwfef
5ewf
6fwffeffew
7wfewf
8wfwfw
9rhreerr
10frr
11
12
13Items - description
14Nr.Namematerialquantitypicturesubpart
151AAAX1231
162BBBX2342
173CCCX3563
184DDDX4324
195EEEX5125
206FFFX646
217GGGX767
228HHHX8548
239IIIX9329
24SUM:253
25
26
27
28Items - details
29Nr.Namematerialpricecostxxx
301AAAX111xxx
312BBBX222xxx
323CCCX331xxx
334DDDX452xxx
345EEEX541xxx
356FFFX632xxx
367GGGX721xxx
378HHHX812xxx
389IIIX921xxx
39
40
41
42
Sheet1
Cell Formulas
RangeFormula
D24D24=SUM(D15:D23)
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,272
Messages
6,177,631
Members
452,786
Latest member
k3calloway

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top