VBA choose columns and paste to new sheet

I have user data in User_Columns. The user will paste this data in. It can have any number of rows or columns.
The second tab will be Needed_Columns - which is where the chosen columns will be pasted.
The second tab is now populated with what the end result should be.

I would like a message box to ask the user to identify each column of the User_Data.
Something like "What column is your 'Zone' located?", "What column is your 'Service' located?, etc.
(The columns are on Needed_Columns tab)
There are 14 columns needed.

Then the VBA would choose those columns, paste into the Needed_Columns tab and change the header names from the users to mine.

Can anyone help? Thanks!
Sample-FILE.xlsx
Euro5Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Haven't we done something similar to this before?
Martin LissOlder than dirtCommented:
The question I remembered was this one. Except for perhaps the names and numbers of columns, how is this question any different?
Euro5Author Commented:
Hi Martin,
It is only different because of the names, number columns and that I need to copy and paste those selections to a second sheet. These are different projects, but I liked the method of choosing the columns very well.
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Martin LissOlder than dirtCommented:
In the old workbook we had a sheets named "Data" and "Filtered_Data". In the new workbook, which sheet is the equivalent to the old "Data" sheet?

Also In the old workbook while there were more columns, you were only interested in 9 of them, namely "Rated Weight", "Date Delivered", "Street Address", "Zone", "Origin Zip", "Recipient Zip", "City", "State" and "Pay Type". Please let me know which ones you're interested in now. If it's easier let me know which ones you're not interested in.
Euro5Author Commented:
The columns needed are:
"Service Type      " "Package Type"      "Zone"      "Shipment Rated Weight"      "Original Weight"      "Pieces in Shipment"      "Index"      "Shipper State"      "Shipper Country"       "Recipient State"      "Recipient Country Code"      "Dimmed Height"       "Dimmed Width"      "Dimmed Length"


The old 'Data' sheet is the equivalent to 'User Columns' in my latest upload in this question.
Martin LissOlder than dirtCommented:
Thanks. I should have the solution sometime today.
Martin LissOlder than dirtCommented:
Here's the first step. Some of the changes are:

The userform has the new columns.

The data in the userform's  comboboxes are sorted. I did that because there are 41 user columns and I thought it would be easier to use if there names were sorted.

The 'OK' button on the userform is disabled. I did that because currently the workbook doesn't contain the 'Report (and other) sheet(s) and it doesn't have the code modules required to actually produce the report and clicking that button would mess things up. Do you still want a report? If so please add the needed sheets and modules to this workbook, upload it, and I think I can do the rest.
Q-28684250.xlsm
Euro5Author Commented:
I have the form in this attachment.
This workbook is the complete project, with all modules.


2 notes: I changed the tab names from User_Columns & Needed_Columns to Shipping & Reduced Data tabs.
I changed them in the userform code. Also, there is no other criteria as there was in the last project. Just choose the columns and copy them all over.

The user form would be the FIRST thing that happens, as it puts the data into the Reduced_Data tab, where most of the events are taking place. After that, it will call each sub from RunSeries()

I hope all that is clear!?
rerate-v7-sample-6.3.xlsm
Martin LissOlder than dirtCommented:
Currently only 5 Shipping columns are an exact name match for the "needed" columns on the Reduced Data sheet. So that I can test this, can you tell me which Shipping columns relate to the "needed" columns?
Euro5Author Commented:
Sure,
Reduced Data  - Shipping
Service - Service Type
Package Type - Package Type
Zone - Pricing Zone
Ship Rated Weight - Shipment Rated Weight
Original Weight - Original Weight
Pieces in Shipment - Pieces in shipment
Index - Shipment Tracking number
Shipper State - Shipper State
Shipper Country - Shipper Country
Recipient St -Recipient State
Recipient Country Code - Recipient Country Code
DIM Height - Dimmed Height
DIM Width - Dimmed Width
DIM Length - Dimmed Length
Martin LissOlder than dirtCommented:
I may not have the right file because for example I can't find "DIM Height". In the file you uploaded, these are the headings in 'Reduced data'
Service Type
Package Type
Zone
Shipment Rated Weight
Original Weight
Pieces in Shipment
Index
Shipper State
Shipper Country
Recipient State
Recipient Country Code
Dimmed Height
Dimmed Width
Dimmed Length
Service 1
Service 2
Old DIM
New DIM
Old Rated Weight
New Rated Weight
Net Rates 1 OLD DIM
Net Rates 2 NEW DIM
Net Rates 1 NEW DIM
Net Rates 2 NEW DIM

and these are the headings in 'Shipping'
Payer Account
National Account
Sub Group
Invoice Date (yyyymm)
OPCO
Service Type
Pay Type
Shipment Date
Shipment Delivery Date
Shipment Tracking Number
Shipper State
Shipper Postal Code
Shipper Country
Shipment Freight Charge Amount
Shipment Miscellaneous Charge
Shipment Duty and Tax Charge
Shipment Discount Amount
Net
Net Charge Amount
Pieces in Shipment
Shipment Rated Weight
Original Weight
Recipient State
Recipient Postal Code
Recipient Country Code
Reference Notes Line 1
PO Number
Pricing Zone
Shipment Dim Flag (Y or N)
Dimmed Height
Dimmed Width
Dimmed Length
Recipient Original Address
Recipient Original City
Recipient Original State
Recipient Original Postal Code
Recipient Original Country
Shipment Declared Value Amount
Dom_Intl
Package Type
Shipment Delivery Time
Martin LissOlder than dirtCommented:
In addition to the problem above, I have a question. In production is it ever possible that there is no matching column between the two sheets? What I mean is for example, one of the "needed columns" is "Payer Account". Is it possible that there might not be an equivalent column in 'Shipping'?
Euro5Author Commented:
1. Dimmed Height = Dimmed Height Dimmed Length = Dimmed Length Dimmed Width = Dimmed Width
2. There will never be a situation where there is a column "needed" that will not be on the Shipping tab.    
     If the 'needed' column is not included, they can't run the report at all.
     The Payer Account is in the typical Shipping data, but is not a "needed" column.
Martin LissOlder than dirtCommented:
I'm confused. In post 40812538 you say
Sure,
Reduced Data  - Shipping
...
DIM Height - Dimmed Height
DIM Width - Dimmed Width
DIM Length - Dimmed Length
which says to me that the 'Reduced Data' tab should have "DIM Height", "DIM Width" and "DIM Length" column headers but in my post 40812900 I showed what was in the 'Reduced Data' tab in your uploaded workbook and those columns aren't there (or anywhere).
Euro5Author Commented:
So sorry - yes, I just typed it wrong.
In the users data on Shipping tab, there should be a column that would match to "Dimmed Height", "Dimmed Width", & "Dimmed Length". (NOT DIM Height, DIM Width, DIM Length).

There would be nothing on the Reduced Data tab until the selected columns were chosen from Shipping tab and then pasted to Reduced Data.
Martin LissOlder than dirtCommented:
In the project I referred to in my post 40809437 (my second post above), we would put a column heading of "Rated Weight" in column "O" of the data sheet and put a value of >=20 in O2, copy the data to Filtered_Data and clear O1 and O2. I understand the copying of the columns but do you have any idea what the >=20 is all about? BTW the value is partially calculated from data on the 'Details' sheet that the current project doesn't have.
Martin LissOlder than dirtCommented:
I figured it out. The >=20 causes only those rows that have a Rated Weight of 20 or more to the Filtered_Data sheet. Is there any similar requirement in this workbook?
Euro5Author Commented:
No there is not.
Martin LissOlder than dirtCommented:
Sorry this took so long. There was some existing code that I didn't understand (and still don't) so I created my own and that took longer. Give this a try and make sure I got everything right.
Q-28684250a.xlsm

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Euro5Author Commented:
No problem at all! Looking now..
Euro5Author Commented:
That looks perfect - thank you!! :)
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.