VBA to create new workbook from most recent user-numbers from an exported list

fabrizioserra

New Member
Joined
Apr 15, 2012
Messages
2
Dear all,

I need to create a macro that can produce a new workbook with the list of the most recent users of my company, so that we can print their membership cards.

From my company's admin I can export the complete list of users with their name, serial number and address. Every time we export this list, the file is saved as "userdata-dd-mm-yyyy.xls", and "dd-mm-yyyy" as today

However, I would like to create a macro that would
1) open the most recent "userdata-dd-mm-yyyy.xls" workbook in the folder,
2) compare the user numbers in this file with the most recent "card_order-dd-mm-yyyy.xls" and
3) produce a new "card_order-dd-mm-yyyy.xls" workbook with the list of all new users since the last "card_order-dd-mm-yyyy.xls" ("dd-mm-yyyy" as today), based on the highest number for user number (this is a continuous list)

Note, the "userdata-dd-mm-yyyy.xls" workbook has name, serial number, address, expiration date and user number as columns.... but the extracted info to "card_order-dd-mm-yyyy.xls" is just of the name, serial number and expiration date.

What is the easiest way of doing so and what code should I use for the macro?

Thanks a lot and let me know if my explanation is not clear :)
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

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