?
Solved

Excel Macro to Extract Specific Columns to a New Tab

Posted on 2016-11-30
4
Medium Priority
?
116 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 2000 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 32

Expert Comment

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

777 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