+ Reply to Thread
Results 1 to 20 of 20

Filter with merged cells maybe there is an alternative way

Hybrid View

  1. #1
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Smile Filter with merged cells maybe there is an alternative way

    Hi everybody, as my account name, I am new here.

    Straight to my problem

    I am organizing an audit summary.
    For each company, there are 10 rows, and the first few columns (say A, B,and C), they are merged for COMPANY NAME, LOCATION, NUMBER.
    Then from column D, it starts revision records, which means 10 rows may or may not be filled completely. Some may be filled up to the 5th row, and some are only 2nd row.

    So later when I am trying to filter by those who are in the 2nd revision, problem comes. Autofit doesn't work which is expected, but also the entire worksheet looks not nice.

    What I would like to have is to filter on the revision column, but no mater how many rows are filled in, it will be nice if all 10 rows for the companies that satisfy the 2nd revision to show up as the entire 10 rows.

    Any one could provide me with a good idea ?

    big thanks
    Attached Files Attached Files
    Last edited by Iamnew; 01-25-2016 at 12:08 PM. Reason: attachment added

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    Hello Iamnew,

    Welcome to the Forum!

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

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

    View Pic
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    Hi xladept

    Thanks for tips, now added the attachment.

    Looking forward, any solution or alternative ways

    Thanks !

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    Hi Iamnew,

    I need more explanation - I'm not noticing a great difference in what you want to achieve from what you have

  5. #5
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    For example, the original "project" column merges 7 row.
    After the filter on Column E "result"
    Is it possible to keep the "project" column with merged 7 rows but only eliminate the "x" "active" "fail" and projects that do not contain "pass"

    Last edited by Iamnew; 01-25-2016 at 02:15 PM.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Filter with merged cells maybe there is an alternative way

    You can't do that, you need to repeat the data for each row. The nearest I can think of to get to the layout you want is to have the data in every row and then a Pivot table summarising it (with not values) - would look like the attached
    Attached Images Attached Images
    Last edited by Kyle123; 01-25-2016 at 12:49 PM.

  7. #7
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    I understand yours, thanks.

    But is there a different way of doing this ?

    Maybe not merging the PROJECT, but do something makes them looks the same ?

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Filter with merged cells maybe there is an alternative way

    No, there isn't Excel can't filter merged cells. Many people online will tell you avoid merged cells altogether, they're more trouble than they're worth

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    Maybe:

    Sub Iamnew(): Dim we As Worksheet, wa As Worksheet, r As Long
    Set we = Sheets("Example sheet ") 'Trailing Space in Sheet Name
    Worksheets.Add(After:=Worksheets(Worksheets.count)).Name = "to achieve"
    Set wa = Sheets("to achieve"): we.Cells.Copy wa.Cells(1, 1)
    For r = 3 To Rows.Find("*", , , , xlByRows, xlPrevious).Row
    If Cells(r, 6) = "" Then Rows(r).Hidden = True
    Next r: End Sub

  10. #10
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    This works partially, I think I will work something on the un-merged cells first, then come to you guys later.
    Thanks a lot.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    In what ways does it not work? If you'll enumerate them, I may figure out another "work-around"

  12. #12
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    I put this code in the real file, there are different input like text, number, date and symbol all in one column, seems pretty difficult to align. It s a worksheet with 32,000 rows, so I d better learn to make a new data worksheet.

    Do you have any better idea than this one ?
    Since we are doing audit, there are mainly companies, entry date, result 1, result 2, result 3, comment, and manager name.
    What will be a good way to start this kind of document ?


  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    But, if you only want to see the records with "pass" in Column E, then the last routine which I added to post #13 will do that.

  14. #14
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    I have no VBA background, if I am going to apply this code to our documents, feels pretty challenging .
    Is there any equivalent way just using the user interface ?

  15. #15
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    I changed the style into a Pivot table, seems a way better than my complicated request.

    Thanks anyway, i think I need to learn some basic VBA to facilitate tings much more.

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    Is the sample truly representative?

    Meanwhile try this:

    Sub Iamnew(): Dim we As Worksheet, wa As Worksheet, r As Long, H As Range, E
    Set we = Sheets("Example sheet ") 'Trailing Space in Sheet Name
    Worksheets.Add(After:=Worksheets(Worksheets.count)).Name = "to achieve"
    Set wa = Sheets("to achieve"): we.Cells.Copy wa.Cells(1, 1)
    E = wa.Range("E1:E" & wa.Rows.Find("*", , , , xlByRows, xlPrevious).Row)
    For r = 3 To UBound(E)
    If LCase(E(r, 1)) <> "pass" Then
    If H Is Nothing Then Set H = Rows(r) Else Set H = Union(H, Rows(r))
    End If
    Next r: H.EntireRow.Hidden = True: End Sub
    Last edited by xladept; 02-02-2016 at 12:27 PM.

  17. #17
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    Yes it is.

    the difference is

    1. there are more columns with various input types.
    2. more rows standing for more companies.

    but in the sample I have neat input, while in the real one, some text/symbol/garbage are put in the cells that belong to "date" or "rev." columns. it s vast and confidential, so cannot copy that here.
    Last edited by Iamnew; 02-02-2016 at 12:25 PM.

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Filter with merged cells maybe there is an alternative way

    I put this code in a standard module which I inserted into your book and I saved your book as macro enabled:

    Option Explicit
    
    Sub Iamnew(): Dim we As Worksheet, wa As Worksheet, r As Long, H As Range, E
            For Each wa In Worksheets
            wa.Name = Trim(wa.Name)
            If wa.Name = "to achieve" Then GoTo Setwa
            Next
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "to achieve"
    Setwa:  Set wa = Sheets("to achieve"): Set we = Sheets("Example sheet")
                we.Columns.AutoFit: we.Cells.Copy wa.Cells(1, 1)
    E = wa.Range("E1:E" & wa.Rows.Find("*", , , , xlByRows, xlPrevious).Row)
                    For r = 3 To UBound(E)
                        If LCase(E(r, 1)) <> "pass" Then
    If H Is Nothing Then Set H = wa.Rows(r) Else Set H = Union(H, wa.Rows(r))
                        End If
    Next r: H.EntireRow.Hidden = True: wa.Columns.AutoFit: End Sub
    *You need to change the red sheet names to what they should be and then just copy
    and paste your actual data to the "Example sheet" (The button in D1 should not be
    affected by this) and then just click on the button!

    ** But I'm not sure if this is what you want
    Attached Files Attached Files
    Last edited by xladept; 02-03-2016 at 01:39 PM.

  19. #19
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Filter with merged cells maybe there is an alternative way

    Told you so

  20. #20
    Registered User
    Join Date
    01-25-2016
    Location
    the Netherlands
    MS-Off Ver
    MS2010
    Posts
    15

    Re: Filter with merged cells maybe there is an alternative way

    Indeed.

    Is there any handy material or web you recommend as a start for Macro or VBA ? I know nothing about them.

+ 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. Replies: 0
    Last Post: 11-25-2014, 07:08 AM
  2. Filter with merged cells
    By Simon.xlsx in forum Excel General
    Replies: 0
    Last Post: 10-21-2014, 07:57 AM
  3. How to use filter with merged cells
    By Elainefish in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-29-2013, 09:32 AM
  4. Replies: 1
    Last Post: 06-28-2012, 11:53 AM
  5. auto filter is now working with merged cells
    By jessy_com in forum Excel General
    Replies: 2
    Last Post: 02-07-2008, 12:36 PM
  6. [SOLVED] How do I filter columns of merged cells to show all related rows?
    By mosaic in forum Excel General
    Replies: 2
    Last Post: 07-05-2006, 05:10 AM
  7. [SOLVED] auto filter in merged cells
    By plainclothman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2006, 08:45 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