VBA loop to duplicate rows based number of days per month

mybyby

New Member
Joined
Mar 18, 2018
Messages
1
Hi guys

I need your help guys to write VBA code to duplicate rows based on number of days per months
I have monthly order number but it is not comparable to daily actuals, what I need is to populate the table into daily file based on number days per month. e.g. I need 31 rows for first data below.

Appreciate your help. Thanks!


Customer NameEOMDateOrderQtyRemarksNo of Days per monthDailyTarget (OrderQtyMth/No of days)
AAAA31/1/2017
17689

<tbody>
</tbody>
Store131
570.6129

<tbody>
</tbody>
AAAA28/02/2017
1,806

<tbody>
</tbody>
Store128
64.5

<tbody>
</tbody>
BBBB31/1/2017
22,029

<tbody>
</tbody>
Store131
710.6129

<tbody>
</tbody>
BBBB28/02/2017
2,500

<tbody>
</tbody>
Store128
89.28571

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi,

In column "No of Days per month":

=DAY(EOMONTH("EOMDate",0))

Replace "EOMDate" with the matching cell

Or if EOMDate is already the end of the month, just do :

=DAY("EOMDate")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

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