+ Reply to Thread
Results 1 to 3 of 3

Excel VBA macro to import and sort data from one file into another

  1. #1
    Registered User
    Join Date
    10-18-2018
    Location
    Munich
    MS-Off Ver
    2013
    Posts
    2

    Excel VBA macro to import and sort data from one file into another

    Hello,

    I am new to this site and to VBA, so please bare with me.

    I need a macro for work to import data from an Excel file into a "Master"-Excel and sort it in a table. The task is to list occured events based on calendar weeks (CW).
    The input (separate Excel file) is the frequency of events in the CW and the result (master list) should look something like this:

    Event CW30 CW31 CW32
    A ....... 3 ................. 4
    B ....... 2 ....... 5 ....... 2
    C .................. 7 ...... 1
    D ............................ 1

    If the event is present in the master-list, then add a column with the frequency for that CW.
    If the event was not present before, then add a row with that event at the end and a column with the frequency.

    I hope this is possible.
    Thank you.

    Best regards,
    mood66

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Excel VBA macro to import and sort data from one file into another

    Yes, It's possible.

    Will you please attach a SMALL sample Excel workbooks (10-20 rows of data is usually enough) - both input file and master workbook? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If trere are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, etc. - please show them all or at least indicate in text) The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution(s) is/are also shown (mock up the results manually).

    3. Make sure that all confidential/restricted information (either personal or business) like real e-mails, social security numbers, bank accounts, etc. is removed first!!

    To attach an Excel file you have to do the following: Just before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    10-18-2018
    Location
    Munich
    MS-Off Ver
    2013
    Posts
    2

    Re: Excel VBA macro to import and sort data from one file into another

    Hello Kaper,

    thank you for the quick answer.

    I attached some example workbooks, but had to rename much of the data because of restricted information.
    The input is basically a simple report generated by an external program. The columns are fixed. Unfortunately there is no timestamp in the report, but one report = one day.
    The idea was to import such a report with the help of a button (macro), thus adding the data in the correct order in the master table.

    Thanks again and have a nice day.
    Attached Files Attached Files
    Last edited by mood66; 10-18-2018 at 11:10 AM.

+ 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. Best way to import data to macro enabled excel file
    By Blackhawks in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2016, 05:23 PM
  2. [SOLVED] How do I create a macro to import and sort a txt file with more than one delimiter?
    By JonnyEnglish in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2016, 03:57 AM
  3. [SOLVED] Import text file and sort the data
    By amar05 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2016, 01:58 PM
  4. Excel Macro to import Survey data as well as sort & format
    By nirmalreigns in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2014, 12:52 PM
  5. Excel Macro to Import Specific Data from Txt File
    By Niklasfirst in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-22-2013, 12:41 PM
  6. Macro to Import Excel Data into an MS Access File
    By SaurabhShri1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-26-2013, 08:08 AM
  7. Replies: 2
    Last Post: 08-05-2012, 02:58 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