+ Reply to Thread
Results 1 to 8 of 8

split column into multiple files into multiple columns based on another file

  1. #1
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    split column into multiple files into multiple columns based on another file

    hi
    I would split column B into files PUR1,PUR2 into multiple columns into column B,C,D,E based on splited data file SEARCH into columns B,C,D . the result should be in first sheet into files PUR1,2 and should replace the data every time run the macro . I put the expected result in both the files in sheet result . I have about five files in the same folder whit the same structure as in PUR1,2

    thanks in advance
    Attached Files Attached Files
    Last edited by Hasson; 01-31-2022 at 05:22 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,245

    Re: split column into multiple files into multiple columns based on another file

    Is there any reason why you have separate workbooks rather than putting all the data in one workbook with 2 sheets per "PURx"??

    See attached

    Named range "Key" based on formula in H of "RP"

    =D2& " " &E2& " " &F2

    in c2 of "PUR1B"

    =IFERROR(INDEX(RP!D$2:D$1000,MATCH(PUR1A!$B2,Key,0)),"")

    copy across to E

    in F2

    =IFERROR(INDEX(PUR1A!E$2:E$1000,MATCH(PUR1A!$B2,PUR1A!$B$2:$B$1000,0)),"")
    Attached Files Attached Files
    Last edited by JohnTopley; 01-16-2022 at 12:33 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,245

    Re: split column into multiple files into multiple columns based on another file

    VBA version

    Please Login or Register  to view this content.
    Assumes ALL files in the selected folder are to be processed.

    Ensure TAB names are consistent (currently "Report" and "Result")
    Attached Files Attached Files
    Last edited by JohnTopley; 01-17-2022 at 03:39 AM.

  4. #4
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: split column into multiple files into multiple columns based on another file

    Is there any reason why you have separate workbooks rather than putting all the data in one workbook with 2 sheets per "PURx"??
    yes , theses files issued by another company and sent by email throught each month and differnt date .
    the result are put into files just are simple to undersatnd what I want, but my real data for each file are about 500 rows and it will take more time copy & paste in one file . so that's why I look for macro achieve that.
    as to post#3 I prefer VBA I will test it and inform you how works .

  5. #5
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: split column into multiple files into multiple columns based on another file

    thanks . I would as I siad in OP
    the rsult should be in first sheet into files PUR1,2
    the sheet RESULT just to see how could be . the result should just be in the first sheet for all files are existed in the folder.
    last thing I don't want selected folder way by browser . I would do that automatically without select folder .

  6. #6
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: split column into multiple files into multiple columns based on another file

    another choice experts?

  7. #7
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: split column into multiple files into multiple columns based on another file

    cross posted https://www.mrexcel.com/board/thread...-file.1193454/
    no answer so far and edited the file

  8. #8
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    210

    Re: split column into multiple files into multiple columns based on another file

    I would add note , if the items in column B into files PUR1,PUR2 are not matched with columns B,C,D, based on splited data file SEARCH then should not split and show message " there items are not matched you should correct them before split "

+ 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. [SOLVED] split column to multiple columns based on extension files
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-11-2021, 12:31 PM
  2. Split Excel file into multiple Excel files based on specific column value
    By qiyusi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2018, 10:08 PM
  3. Split a File to Multiple files with Selected columns into CSV format
    By suchetherrah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2017, 11:46 AM
  4. Replies: 4
    Last Post: 10-04-2015, 08:21 AM
  5. Split one Excel file into multiple files based on values in column A?
    By MetroBOS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2015, 10:59 AM
  6. Split Excel file into multiple files based on number of rows
    By kingtut86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 03:38 PM
  7. Replies: 3
    Last Post: 08-02-2006, 12:35 PM

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