Excel VBA connected to external files

TomExcel1234

New Member
Joined
May 17, 2021
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hello,

i would appreciate any help in building macro for the task below, please. Heres a brief summary:

Issue:
I have list of image frames in sequential order (for instance from frame 1 to frame 10'000 or 20'000). The frames are either in .jpg or .png format. The issue is that from time to time, some frames are missing = for instance, the frame sequence would be .... 10'000.png, 10'001.png, 10'002.npg, 10'004.png... etc (hence frame 10'003.png missing).

Desired Macro:
The macro should go into the folder and see what frames are missing in sequence. If no frames are missing => do nothing. If frames are missing => then macro should take previous frame, copy it and rename it to fill the sequence. For instance:

Before macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'004.png (one frame 10'003.png is missing)
After macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'003.png 10'004.png (frame 10'003.png is a copy of 10'002.png to fill the sequence)


In case multiple frames are missing in a row, then the logic remains the same:

Before macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'006.png (three frames 10'003.png, 10'004.png and 10'005.png are missing)
After macro is run:
Sequence would be .... 10'000.png, 10'001.png, 10'002.png, 10'003.png 10'004.png, 10'005.png, 10'006.png (frames 10'003.png, 10'004.png and 10'005.png are all a copy of frame 10'002.png to fill the sequence)

The macro would be based on naming of the files only. It would neither open nor analyze frames themselves.


Thank you very much for any help.

Best regards.
 
Glad it worked.
Please mark post #8 as solution for future readers.
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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