• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

Excel Macro to Extract Specific Columns to a New Tab

Hello EE,

I have data in one tab and i wanted to create a new tab called Expected and only copy and paste part of the data based on column address or column name. I have attached example.

I have the following columns in the data tab
Account      Customer State Achieved Earnings Customer2 Supervisor      President

I want create an new tab and call it Expected and copy data in the following columns into the Expected tab
Account       Customer Achieved Earnings Supervisor       President

Thanks in advance for your help
Sample.xlsx
0
fb1990
Asked:
fb1990
  • 2
1 Solution
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please find the attached with the code on Module1 and a button called "Copy Data" on Data Sheet.
You may click the button to run the code to copy the data from Data Sheet onto Expected Sheet.
-Sample.xlsm
0
 
Rob HensonFinance AnalystCommented:
You can achieve this with the Advanced Filter function.

The destination range can have as few or as many of the source headers and in whichever order you want.

Advanced Filter normally expects you to copy an extract of the data that meets a particular criteria, if you set the criteria so that it copies all rows you will get what is required.
0
 
fb1990Author Commented:
Thanks to Neeraj and Rob.  Neeraj's solution gave me exactly what I want.  Thank you Sir.
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome FB! Glad it worked as per your requirement.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now