+ Reply to Thread
Results 1 to 6 of 6

Filtering and generating new tabs based on Unique values based in column

  1. #1
    Forum Contributor
    Join Date
    01-26-2012
    Location
    Mumbai
    MS-Off Ver
    Excel 2013
    Posts
    154

    Filtering and generating new tabs based on Unique values based in column

    Dear ,


    For understanding this project ,please see the attached workbook's......

    The first one "Input "see the tab called final ,

    Now ,please open the spreadsheet input 1 and see tab Final 2.......

    The only difference between Final and final 2 is that the blank rows (Note it does have value in cell H -But for my purpose any row with value just in H is a blank row and needs to be deleted and new tab needs to be prepared exactly like final 1 ......

    Now in final 2,you will see that i fill blank entries in column E as NOT FOUND ,

    Now see attached sheet DBC project filter Output sheet ....you will note that based on unique values in column E ,seperate tabs are created -i did use datapig explosion for the purpose but wish that i can have a macro for the purpose ...

    Also you will note that the attached macro already has a subroutine defined which generates the final sheet based on content of sheet 1 and sheet 2 .......

    (is it possible that you make this macro and call oit from the first macro so that on single click of the first subroutine ,all the filtering and then further tabbing takes place )
    Anyways ,just making a mcro for the thread will solve my worry ,since i can then easily call the macro from the first macro myself ,

    Thanks in advance ,

    Regards ,


    Amlan Dutta
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-26-2012
    Location
    Mumbai
    MS-Off Ver
    Excel 2013
    Posts
    154

    Re: Filtering and generating new tabs based on Unique values based in column

    I have got great help from Zbor for the first part of the case in thread at link
    http://www.excelforum.com/excel-misc...ate-tab-2.html

    ->wherein solely because of his input, the first first part of it stays solved

    In the main routine i call the following 2 subroutines which helps me achieve what i want in terms changing to uppercase ,also of deletion of blank rows and insertion of "NOT FOUND"in empty E cells ,

    The subroutines go like this ,
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Please find input and output file attached,

    Now main task remains filtering into seperate tabs based on unique values in Column E and naming the tabs after those unique values in E ,

    I repeat that first part of the project has become possible to solve due to thread at

    http://www.excelforum.com/excel-misc...ate-tab-2.html

    Now only i need to filter tabs based on unique values in column E

    Appreciate if i recieve some help there ,

    Regards ,

    Amlan
    Last edited by amlan009; 07-01-2012 at 07:06 AM.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Filtering and generating new tabs based on Unique values based in column

    Hi Amlan, try this
    Please Login or Register  to view this content.
    Also try this line instead of 'Call notfound'
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-26-2012
    Location
    Mumbai
    MS-Off Ver
    Excel 2013
    Posts
    154

    Re: Filtering and generating new tabs based on Unique values based in column

    You my friend ,is a pure genius !

    This works like magic !

    But the code is very difficult to understand for a newcomer like me ,but is a brilliant piece of work ,trust me ,what you have done using your code simply is beyond my mind to do manually ,

    But i want to be in a through position to understand whats happening here ,

    an you please explain what's happening here ,

    Please Login or Register  to view this content.
    what is the compare mode and what are the keys?

    also what is this line doing ?

    Please Login or Register  to view this content.
    Find the input and output file attached !

    This is just perfect ,

    I also want to know whether you can increase the column width in the output file for all columns to 40 pixels or something which will help us see clearly all contents ,you will see that if the column width is less than the conetnt appears as ##### and we have to drag the column width ...can the macro handle to arrange the column width so as to make it visible ,

    I will take a little assistance of yourself for understanding the code ,

    P.S- I don't know how to use the alternative you gave in place of Call NOTFOUND ,i mean i am clueless as to where i should be putting it !

    The entire code which i used for managing the input and output files is as follows ,

    Please Login or Register  to view this content.
    Humble regards ,


    Amlan Dutta
    Attached Files Attached Files

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Filtering and generating new tabs based on Unique values based in column

    Quote Originally Posted by amlan009 View Post
    ...I also want to know whether you can increase the column width in the output file for all columns ...
    Try changing these lines
    Please Login or Register  to view this content.
    Dictionary is an object that can contain only unique values ​​of keys.
    x = .keys is an array of dictionary keys, i.e. sheet names.
    Expression of If Not Evaluate("ISREF('" & x(i, 1) & "'!A1)") Then examines whether there is a worksheet named x(i, 1).

    You can write a line
    Please Login or Register  to view this content.
    instead of a line
    Please Login or Register  to view this content.
    in your code.

  6. #6
    Forum Contributor
    Join Date
    01-26-2012
    Location
    Mumbai
    MS-Off Ver
    Excel 2013
    Posts
    154

    Re: Filtering and generating new tabs based on Unique values based in column

    Hiya,

    Sorry for the late revert ,i was studying the code and adding comments to understand the code ,at the end of each line ,i have added a comment wherein at times i understand completely what's going on but at times i am clueless because of advanced function's used ....if someone can comment on the parts ,i would be most grateful since it would help me understand the solution instead of just using it

    Please Login or Register  to view this content.
    Thanks ,

    Amlan Dutta
    Last edited by amlan009; 07-02-2012 at 09:51 PM. Reason: Refining further the commenting(questions)

+ 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