Solved

Excel Macro to Extract Specific Columns to a New Tab

Posted on 2016-11-30
4
29 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 28

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 31

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 28

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now