+ Reply to Thread
Results 1 to 5 of 5

Find specific column name and paste the data from different worksheets

Hybrid View

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Find specific column name and paste the data from different worksheets

    Hi,

    I have no idea how to paste data based on column name.
    Can anyone please help to guide me? Attached sample workbook for your reference.
    Thanks in advanced.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Find specific column name and paste the data from different worksheets

    This button (macro) replicates your data, but after writing it I then realized it's not quite what you asked for.

    sample - modified.xlsm

    I'm only searching the MasterList tab for the NAME column, and I'm assuming that GENDER and AGE will be the next two columns. (As it is in the example.)

    Likewise with the RawData worksheet tab. I'm only searching for the CustomerName column, and assuming that the *** column comes immediately after.

    If that IS the case, then this macro will work fine. But if the Gender and age columns could be in ANY column, the macro will have to be modified. But you might be able to modify it yourself, after viewing the code.

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Find specific column name and paste the data from different worksheets

    Quote Originally Posted by Ed_Collins View Post
    This button (macro) replicates your data, but after writing it I then realized it's not quite what you asked for.

    Attachment 235800

    I'm only searching the MasterList tab for the NAME column, and I'm assuming that GENDER and AGE will be the next two columns. (As it is in the example.)

    Likewise with the RawData worksheet tab. I'm only searching for the CustomerName column, and assuming that the *** column comes immediately after.

    If that IS the case, then this macro will work fine. But if the Gender and age columns could be in ANY column, the macro will have to be modified. But you might be able to modify it yourself, after viewing the code.
    thanks Ed_Collins . .i don't really understand after reading the code.

    Do you mind to show me with simple vba, if i just want to copy column "Name" data from sheet "MasterList" and paste to next blank row in column "CustomerName" from RawData list?
    One column data will do.

  4. #4
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Find specific column name and paste the data from different worksheets

    Do you mean like this:

    Sheets("MasterList").Select
    Range("A2:A6").Select
    Selection.Copy
    Sheets("RawData").Select
    Range("A9").Select
    ActiveSheet.Paste

  5. #5
    Registered User
    Join Date
    01-09-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Find specific column name and paste the data from different worksheets

    Quote Originally Posted by Ed_Collins View Post
    Do you mean like this:

    Sheets("MasterList").Select
    Range("A2:A6").Select
    Selection.Copy
    Sheets("RawData").Select
    Range("A9").Select
    ActiveSheet.Paste
    but what if i want to define the criteria by column name and not cell range?
    I want to copy all data from column "Name" and append the data to column "CustomerName" list.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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