+ Reply to Thread
Results 1 to 11 of 11

VBA Macro required for filtered data to a new sheet.

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    VBA Macro required for filtered data to a new sheet.

    Could anyone help me to get macro for the following:
    I have an excel data in a worksheet. I want this data to be filtered for column A header. Say for example "name" is the header for column A. Now this "name" should be filtered and the each of the filtered rows with their header are required to be copied in a new worksheet. The filtered cell value shall be given for the name for the new sheets.

    Example: Here the Name A shall be filtered and copied in a new sheet"A", Name B to sheet"B", Name C to sheet"C".......to indefinite numbers.

    Name Hd2 Hd3 Hd4 Hd5
    A X1 X1 X1 X1
    A Y1 Y1 Y1 Y1
    A Z1 Z1 Z1 Z1
    B X1 X1 X1 X1
    B Y1 Y1 Y1 Y1
    B Z1 Z1 Z1 Z1
    C X1 X1 X1 X1
    C Y1 Y1 Y1 Y1
    C Z1 Z1 Z1 Z1
    D X1 X1 X1 X1
    D Y1 Y1 Y1 Y1
    D Z1 Z1 Z1 Z1


    Thank you friends,
    Last edited by anbub1; 04-03-2013 at 10:27 AM.

  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 Macro required for filtered data to a new sheet.

    Hi anbub1

    This link does just as you describe...if you need help adapting please post your File.

    http://www.excelforum.com/excel-prog...ual-files.html
    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
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Macro required for filtered data to a new sheet.

    Thank you so much.

    Your link matched my requirement. I did little alteration in the VBA code. I removed the codes sorting with colors. Finally I could not find the saved new workbooks anywhere in my system in XP OS. But I could see these files were stored in downloads location in vista OS. So I deleted the close option and made the files open, so that I can close these files manually.

    Is it possible to make file storage location as D:/<folder name>? How to fix it?

    Regards,
    Anbub

  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 Macro required for filtered data to a new sheet.

    Hi Anbub

    Post your Code and one of us will look at it. Please remember to use Code Tags when you do so.

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Macro required for filtered data to a new sheet.

    Dear Mr. John,

    Thank you for your reply. With this attached vba code, I can manage to get separate excel files for every change in first column of sheet "Original". I want these files to be saved with passkeys available in the sheet "Dummy". Passkeys for the first column of sheet "Dummy" is corresponding entry of column 2. These files are to be stored in my D drive & folder Products.

    I hope, I have explained you clearly.

    Thank you once again.

    Regards,

    Anbub
    Attached Files Attached Files

  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 Macro required for filtered data to a new sheet.

    Hi Anbub

    Try this Code. Please note, a Dynamic Named Range titled "ItemCode" has been added to Sheet Dummy... let me know of issues
    Please Login or Register  to view this content.
    Last edited by jaslake; 04-01-2013 at 06:10 PM.

  7. #7
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Macro required for filtered data to a new sheet.

    Dear Mr. John,

    Thanks for your reply. But still I am held up at line "With ws1.Range("ItemCode")". I am getting Run time error '1004': Method 'Range' of object '_Worksheet' failed.

    Could you please help me?

    Regards,

    Anbub

  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 Macro required for filtered data to a new sheet.

    Hi Anbub

    As I pointed out here, you need to Create this Range
    Please Login or Register  to view this content.
    If you don't know how to do that let me know and I'll have the Code do it.

  9. #9
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Macro required for filtered data to a new sheet.

    Thank you so much Mr. John,

    Its working perfectly. Thank you once again.

    Regards,

    Anbub

  10. #10
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    Thumbs up Re: VBA Macro required for filtered data to a new sheet.

    Thank you so much Mr. John,

    Its working perfectly. Thank you once again.

    Regards,

    Anbub

  11. #11
    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 Macro required for filtered data to a new sheet.

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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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