VBA - create a Loop to distribute dates along a year as per Maintenance frequency

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
Guys
I have the scenario below where I would like to create a loop to distribute along the columns (G column on) the date that that maintenance will ocurr based on its ID, Frequency and Due date. I will distribute it for a period of 01 year (365 days or 365 Columns)

For instance, the Maintenance for the ID 9960000192374 ocurrs every week and every month (Different maintenance , so my loop will fill an "x" the next due date to 08th Jan, and the next to 15th Jan, etc until reach the last week of a period of a year. After it, will go to the next row performing the next distribution.


The frequency varies, based on values of the frequency column.


IDEquipmentDisciplineMaintenanceFrequencyDue date01/Jan/1802/Jan/18(...)
996000019374Equipment AMechanicalA1 Week01/01/2018X
996000019374Equipment AInstrumentationB1 Month01/01/2018X
996000019238Equipment CElectricalC3 Months01/01/2018X

<tbody>
</tbody>











The original file contains more than 10k lines, the above table, is a short version of the problem.

Excel Columns reference based on above table:
ID= Column A
Due Date= Column F
(..) Means the others dates until 31st December

How can develop a loop that can distribute these dates?
 
Re: VBA - Help on create a Loop to distribute dates along a year as per Maintenance frequency

I would like to say thank you very much for everyone that tried to assist me.
A highlighted thanks for Mr gmhumphr and of course another special one to Mr MickG for all additional time spent to develop the code and for his patience as well.

This is the best forum ever

Thank you very much
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Re: VBA - Help on create a Loop to distribute dates along a year as per Maintenance frequency

Thank for your kind response
You're very welcome
 
Upvote 0

Forum statistics

Threads
1,215,253
Messages
6,123,891
Members
449,131
Latest member
leobueno

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