+ Reply to Thread
Results 1 to 12 of 12

VBA Help needed - Filter data and save as separate workbook

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    VBA Help needed - Filter data and save as separate workbook

    Hi Folks,

    I have a workbook with lot of records; I want a vba code to do filter "C" Column values and save as new workbook in this folder "C:\joshi" Individually based on "C" column cell values.

    I have attached an excel file of what I'm trying to accomplish. Thanks in advance for your expertise!

    Joshi
    Attached Files Attached Files

  2. #2
    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: VBA Help needed - Filter data and save as separate workbook

    Hi joshi

    Try this in a General Module...let me know of issues.
    Please Login or Register  to view this content.
    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.

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed - Filter data and save as separate workbook

    Hi Jaslake,

    Thanks alot, its working great. Can we add one more condition? If the workbook name existing I want to open that workbook and paste the filtered values. (e.g. if Valve-Manual.xlsx is existing, open that workbook, activate sheet1, clear all cells and paste the filtered data then close the workbook).

    I think this is an extremely tough one, not even sure this is possible!

    Thanks in advance,
    Joshi

  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: VBA Help needed - Filter data and save as separate workbook

    Hi Joshi
    This code accomplishes this
    If the workbook name existing I want to open that workbook and paste the filtered values. (e.g. if Valve-Manual.xlsx is existing, open that workbook, activate sheet1, clear all cells and paste the filtered data then close the workbook).
    Please Login or Register  to view this content.
    Let me know of issues.

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed - Filter data and save as separate workbook

    Hi Jaslake,
    Thanks for your quick reply. One more small issue, I have added some records at bottom and ran the macro again, new workbooks are creating based on new cell values with header but without data. Please help me to resolve this issue.

    Thanks,
    Joshi

  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: VBA Help needed - Filter data and save as separate workbook

    Hi Joshi
    Try this...if this doesn't fix it I'll need to see your modified file.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed - Filter data and save as separate workbook

    Hi Jaslake,
    Thanks for your quick reply. Still the bottom record is not copying. Please find attached the file as advised.

    Thank you so much for your time.
    Joshi
    Attached Files Attached Files
    Last edited by krjoshi; 07-11-2012 at 02:03 PM.

  8. #8
    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: VBA Help needed - Filter data and save as separate workbook

    Hi joshi
    Change this line of code from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Silly error..didn't look close enough. Let me know of issues.

  9. #9
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA Help needed - Filter data and save as separate workbook

    Hi Jaslake,
    Thanks for your quick reply. Still the problem exists, last record is not copying. I noticed that if I repeat the last record then it’s copying

    Thank you so much for your time.
    Joshi
    Last edited by krjoshi; 07-11-2012 at 02:04 PM.

  10. #10
    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: VBA Help needed - Filter data and save as separate workbook

    Hi joshi
    Were you able to change the line of code I referenced? The code appears to work for me on your new file with that change. I'm going to post all the code once again...let me know of issues.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Thumbs up Re: VBA Help needed - Filter data and save as separate workbook

    Hi Jaslake,
    It’s working great. Sorry for the delayed reply.

    Thanks,
    Joshi

  12. #12
    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: VBA Help needed - Filter data and save as separate workbook

    Hi joshi

    You're welcome...glad I could help. If this satisfies your need please mark your Thread as SOLVED.

+ 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