+ Reply to Thread
Results 1 to 7 of 7

Import into excel and filter data to new sheet

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    uk
    MS-Off Ver
    2010
    Posts
    10

    Import into excel and filter data to new sheet

    Guys I need to make macro that starts by:
    Opening an excel sheet (which the VBA code is used on) which will have a button saying select file.
    Then this selects an excel file from a directory to import.
    The imported file has 19 columns but rows in column M needs to contain a string And rows in N needs to contain a number.
    If both conditions are met I want specific columns output on a new sheet. Let's say columns B, C, D, G, K, M, N, O, Q
    on the new sheet I also want a new column consisting of the concatenated value of M & N.

    My VBA usage and skill is very limited. So guys if this makes sense... How tricky does it sound.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Import into excel and filter data to new sheet

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    To add a file to a new post

    To add a file to an existing post.

  3. #3
    Registered User
    Join Date
    07-21-2015
    Location
    uk
    MS-Off Ver
    2010
    Posts
    10

    Re: Import into excel and filter data to new sheet

    Hi guys here is a sample file of the data that I am trying to create the macro for. I am attaching 1 workbook that uses 2 sheets but I want the macro to work on 2 different workbooks. The second sheet shows the results I want. The if condition is based on the second sheet (columns that are highlighted green). I only want the workbook (second sheet) to have the rows that meet that condition. If any input please let me know.
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Import into excel and filter data to new sheet

    Hi tyson187

    In Source Worksheet Column M, will the records of interest ALWAYS contain a "/" (forward slash)?

    You don't demonstrate this in your Sample File...
    I also want a new column consisting of the concatenated value of M & N.
    Where would that go, Column J?

    Will you want three blank Rows separating each record?

    Will the records in the "Result" sheet be cumulative or should they be cleared each time the Code is run?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    07-21-2015
    Location
    uk
    MS-Off Ver
    2010
    Posts
    10

    Re: Import into excel and filter data to new sheet

    @jaslake thank you for reply yes the forward slash is always in col M.
    On the new workbook I want the "Result" sheet cleared each time.
    On the Results sheet I would like a new column added which is the concatenated value of M&N and put in the next free column (removing the / if possible - but not the biggest issue)
    I don't need three blank rows per record. Any input is highly appreciated.
    Last edited by tyson187; 07-27-2015 at 02:09 PM.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Import into excel and filter data to new sheet

    Hi tyson187

    This Code is in attached Workbook Results. Place both Workbooks in the same Folder. Open Results, click the Button. You'll be prompted to open a File (WorksheetMaster.xlsx).
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Import into excel and filter data to new sheet

    Hi tyson187

    You're welcome...glad I could help.

    If this resolves your issue please mark your Thread as SOLVED.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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] Power Pivot SQL Data Import - How to update import filter
    By minnesotaart in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-29-2013, 12:39 PM
  2. Data Import from a excel sheet to Pdf Portfolio
    By SKM189 in forum Excel General
    Replies: 0
    Last Post: 07-13-2012, 06:38 AM
  3. Replies: 1
    Last Post: 02-15-2012, 09:42 PM
  4. Replies: 0
    Last Post: 01-18-2012, 12:48 PM
  5. Import Data from Different Excel Sheet
    By kieranbop in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-19-2011, 10:49 AM
  6. Import Word data into excel sheet
    By Internoob2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2011, 12:45 PM
  7. Excel import data from another sheet
    By alinpion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2011, 03:10 AM
  8. How do I import data from 1 workbook excel sheet into another?
    By LJHolland in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-02-2005, 10:05 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