VBA to split start date and end date into days per month in separate rows

motherindia

Board Regular
Joined
Oct 15, 2015
Messages
218
Hello Sir
I have data on sheet1 as follows;


Cust IDType Begin DateEnd DateNo of days
1Luxury23-Mar-1723-Mar-171
1Luxury28-Mar-1728-Mar-171
1Luxury29-Mar-1729-Mar-171
1Luxury30-Mar-1730-Mar-170.5
1Luxury31-Mar-1731-Mar-170.5
1Luxury08-Apr-1708-Apr-170.5
1Luxury08-Apr-1708-Apr-170.5
1Luxury 10-Apr-17 12-Apr-173

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>

Output needed as below;
Cust IDType Month-YearDayTotal Days
1LuxuryMar-1723,28,29,30,314
1LuxuryApr-178,10,11,124

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>

Regards,
motherindia

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>
 
Wow, its working as I expected.
Thanks once again and you are really my great timesaver.

Regards,
motherindia
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,216,343
Messages
6,130,119
Members
449,558
Latest member
andyamcconnell

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