VBA Excel Format (Based on Date and Criteria)

unknownymous

Board Regular
Joined
Sep 19, 2017
Messages
249
Office Version
  1. 2016
Platform
  1. Windows
Hello Gurus,

Trust you are doing well at this times.

I just wanted to get your thoughts on how to code this.

I have a workbook with two sheets:

Sheet 1

DateAccountReference
12/30/201850000001
11/30/201840000001
10/30/201830000003
09/30/201840000002
08/30/201830000005
07/30/20182000

Sheet 2

BookNameNote12/30/201811/30/201810/30/201809/30/201808/30/201807/30/2018
1111Selena1009590858075
2222Mikex959085807570
3333Taylor858075706560
4444Sean807570656055
5555Connorx706560555055
6666Beth757065605550
7777Tom706560555045
8888Gerry656055504540

I was looking if there's a code for me that I can run so I can have this result: OUTPUT (format)

1. Basically, I need the data in descending date and shares format.
- Data columns from Sheet 1 are the Date , Account and Ref while Book and Number (came from Date Column) from Sheet 2.
- The Dates in Sheet 1 could be long but there will always be a corresponding data based on headers in Sheet 2.
- The macro will copy until the last non blank cell in Sheet 2

DateAccountRefBookNumber
12/30/2018500000011111100
12/30/201850000001222295
12/30/201850000001333390
12/30/201850000001444485
12/30/201850000001555580
12/30/201840000001666675
11/30/201840000001777770
11/30/201840000001888865
11/30/201840000001111195
11/30/201840000001222290
11/30/201840000001333385
11/30/201840000001444480
11/30/201840000001555575
11/30/201840000001666670
...and so on

I always have render much time on this task so any help will be much appreciated.

Thank you in advance :)
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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