+ Reply to Thread
Results 1 to 8 of 8

Hide rows based on same values in cell

  1. #1
    Registered User
    Join Date
    03-06-2015
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    22

    Hide rows based on same values in cell

    I have a large excel sheet and need to hide rows with similar values.
    For every value in a specific cell one row should be kept and all others should be made hidden.

    So at the end I only have a list of unique rows and no more duplicates.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Hide rows based on same values in cell

    This code assumes the data you want to compare in in column A, otherwise you'll need to change the 5 A's to whatever column you want.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-06-2015
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    22

    Re: Hide rows based on same values in cell

    Thank you for the code.
    But when I execute it, I get the following error: Compile error: Variable not defined

    When I close the message the first line is marked yellow: Sub henk400()

    How do I need to solve this issue ?

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Hide rows based on same values in cell

    Add this as the first line of code, directly after your Sub name, but before the For loop:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-06-2015
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    22

    Re: Hide rows based on same values in cell

    Now I get: Run-time error '13': Type mismatch

    the following line is marked yellow:

    Please Login or Register  to view this content.
    Does it matter that the content of the cells are not numeric values ?

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Hide rows based on same values in cell

    Can you post your workbook, or an example workbook that replicates that error, please?

  7. #7
    Registered User
    Join Date
    03-06-2015
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    22

    Re: Hide rows based on same values in cell

    It can be downloaded with the link below.

    I have stripped most data and replaced names, the original sheet has almost 1 million rows. so it is important that I can automate as much as possible.

    I need to remove duplicate rows for column O.

    It would be nice to enable/disable the hidden rows, otherwise I am not able to see the original amount of rows anymore.


    http://www.filedropper.com/test_30

  8. #8
    Registered User
    Join Date
    03-06-2015
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    22

    Re: Hide rows based on same values in cell

    Quote Originally Posted by walruseggman View Post
    Can you post your workbook, or an example workbook that replicates that error, please?
    I have uploaded my workbook and now it is silent here

+ 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] Hide a range of rows based on cell values.
    By klunker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2014, 10:26 AM
  2. Need help to show/hide rows based on values from a cell
    By concurmgr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-19-2012, 02:56 PM
  3. hide/unhide rows based on multiple cell values
    By saninmelbourne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2012, 06:45 PM
  4. Hide Rows based on cell values
    By Chinny123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2011, 08:45 AM
  5. Hide rows based on cell values
    By mlb830 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-18-2009, 05:05 PM

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