+ Reply to Thread
Results 1 to 4 of 4

Copy Columns to another sheet based on column heading

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    75

    Copy Columns to another sheet based on column heading

    Hello All,

    Does anyone have an idea on how to copy columns based on a Client's file. I receive files from different clients and the headers are all different. I need a way to copy each column that wont be in the same position from the clients sheet to my generic sheet. I know that I could create a macro for each individual client and run accordingly but i was trying to clean this up a bit. I was possibly thinking about having a table with client name, their field, my field and copy columns. If there is an easier way that would be great.

    I have attached a sample work sheet with my table idea.

    Thanks for your help
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Copy Columns to another sheet based on column heading

    Hi

    I think the table is a sensible idea, but I don't think you've laid it out in an optimal way. I think a better way would be to list the Clients just once in Column A, and have the 'My Format' columns as headers along the first row, with the client info for each matching header along the row, like:

    My Format Date Description Cost
    Client A date_of_sale explanation amount
    Client B date desc due
    Client C date received info amount due

    That way you're reducing duplication of info, and it'll be easier to loop through the relevant columns using VBA.

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Columns to another sheet based on column heading

    How would I loop through that in the most efficient way. I am still learning VBA.

  4. #4
    Registered User
    Join Date
    09-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Columns to another sheet based on column heading

    I have entered the code to my Workbook. This copies the values from one sheet to another as long as the headings are the same. How could I tweak this in order to look up the client specific column heading in the Table matrix?

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. copy contents to other sheet based on heading
    By dealer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2014, 05:14 AM
  2. Replies: 3
    Last Post: 06-13-2013, 11:37 AM
  3. [SOLVED] Delete columns based upon a column heading?
    By Bandicoot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2013, 10:02 AM
  4. Macro to filter based on column heading then copy and paste to new sheet
    By macattackr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2012, 05:14 PM
  5. Search for column heading and copy column onto another sheet
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 05:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1