VBA to copy columns to new sheet with new order and two or more criteria


New Member
Mar 29, 2019
Hello, everyone

This is my first post here and I have a question

I apologize in advance for my bad English

My girlfriend has a home for elderly people and I want to simplify her work

I have an Excel workbook in which I have made several documents and two lists of people who are housed in an elderly home.

One list is with all accommodated people from 2006 until now.
The second list is for this year only - only for people who were accommodated on 01.01.2019 and all accommodated after that date.

For government statistics every month a new list should be made from annual list, but with different order of columns and in new sheet one column must have formula from column in annual list. A separate list should be made for each house.

An example of an annual list and a monthly list can be found in the attachment and formula in column D (with the new name of this column). In new list Column 'F' - "Contract number" must be empty for now, dates must be in dd.mm.yyyy format

I want to create a button and with this button after entering the month, data to be copied to the new sheets. Perhaps it should be checked whether there is already this month and ask for overwrite...

Thanks in advance for help

File: https://yadi.sk/i/nAtDDQ9QfG3OvQ


Well-known Member
Apr 11, 2012
On each monthly sheet you have columns for "Day of birth" and "Contract number" but I don't see these columns in the annual sheet. Where do you get the data for the birth dates and contract numbers?


MrExcel MVP, Moderator
Jun 12, 2014
Office Version
Cross posted on multiple sites.

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
Please supply links to all other sites where you have asked this question.

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...