VBA to distribute data monthwise based on start and end date range

motherindia

Board Regular
Joined
Oct 15, 2015
Messages
218
Dear Sir,

I have 2 sheets . Sheet1 contains 5 columns of data as below;

[TABLE="width: 426"]
<tbody>[TR]
[TD]Unique No[/TD]
[TD]S Date[/TD]
[TD]E Date[/TD]
[TD]Amt[/TD]
[TD]Type[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]01-Apr-17[/TD]
[TD="align: right"]30-Jun-17[/TD]
[TD="align: right"]100[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]01-Jul-17[/TD]
[TD="align: right"]31-Mar-18[/TD]
[TD="align: right"]150[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]01-Apr-17[/TD]
[TD="align: right"]30-Apr-17[/TD]
[TD="align: right"]100[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]01-May-17[/TD]
[TD="align: right"]31-May-17[/TD]
[TD="align: right"]200[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]01-Jun-17[/TD]
[TD="align: right"]30-Jun-17[/TD]
[TD="align: right"]300[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]01-Jul-17[/TD]
[TD="align: right"]31-Jul-17[/TD]
[TD="align: right"]400[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]01-Aug-17[/TD]
[TD="align: right"]31-Aug-17[/TD]
[TD="align: right"]500[/TD]
[TD]B[/TD]
[/TR]
</tbody><colgroup><col><col span="2"><col><col></colgroup>[/TABLE]


I need to update the info Sheet 2 against the unique id as below;

[TABLE="width: 1600"]


<colgroup><col width="64" style="width: 48pt;" span="25">
<tbody>[TR]

[TD="class: xl65, width: 64, bgcolor: transparent"] [/TD]

[TD="class: xl66, width: 768, bgcolor: transparent, colspan: 12"]Amt[/TD]

[TD="class: xl66, width: 768, bgcolor: transparent, colspan: 12"]Type[/TD]

[/TR]

[TR]

[TD="class: xl65, bgcolor: transparent"]Unique No[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Apr-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]May-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Jun-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Jul-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Aug-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Sep-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Oct-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Nov-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Dec-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Jan-18[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Feb-18[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Mar-18[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Apr-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]May-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Jun-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Jul-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Aug-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Sep-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Oct-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Nov-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Dec-17[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Jan-18[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Feb-18[/TD]

[TD="class: xl67, bgcolor: transparent, align: right"]Mar-18[/TD]

[/TR]

[TR]

[TD="class: xl65, bgcolor: transparent, align: right"]1[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]100[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]100[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]100[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]150[/TD]

[TD="class: xl65, bgcolor: transparent"]A[/TD]

[TD="class: xl65, bgcolor: transparent"]A[/TD]

[TD="class: xl65, bgcolor: transparent"]A[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[/TR]

[TR]

[TD="class: xl65, bgcolor: transparent, align: right"]2[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]100[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]200[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]300[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]400[/TD]

[TD="class: xl65, bgcolor: transparent, align: right"]500[/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"]A[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]A[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"]B[/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[TD="class: xl65, bgcolor: transparent"] [/TD]

[/TR]




Kindly do the needful.

regards,
motherindia
</tbody>[/TABLE]
 
Hello Sir,

Can anyone help to modify the code to speed up. It will help me in processing 2 lakh rows quickly.

Regards,
motherindia.
 
Upvote 0

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,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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