Solved

Excel Macro to Extract Specific Columns to a New Tab

Posted on 2016-11-30
4
75 Views
Last Modified: 2016-12-01
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
Comment
Question by:fb1990
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41908199
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
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41908486
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
 
LVL 1

Author Closing Comment

by:fb1990
ID: 41908509
Thanks to Neeraj and Rob.  Neeraj's solution gave me exactly what I want.  Thank you Sir.
0
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41908538
You're welcome FB! Glad it worked as per your requirement.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question