+ Reply to Thread
Results 1 to 7 of 7

Hide Duplicate Rows using Macro

  1. #1
    Registered User
    Join Date
    08-27-2019
    Location
    Philippines
    MS-Off Ver
    365
    Posts
    6

    Hide Duplicate Rows using Macro

    Hi,

    Can anyone help me create a macro to HIDE duplicate rows?
    It should not be REMOVED. Should be hidden only.

    My reference column for duplicates is the last column in the image below.
    I tried to use a macro but I only found remove duplicates.
    hide.png
    Last edited by Rj13; 08-27-2019 at 04:45 AM.

  2. #2
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Hide Duplicate Rows using Macro

    Hello and Welcome to The Forum

    Try this;

    Please Login or Register  to view this content.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Hide Duplicate Rows using Macro

    Another option:-
    Place this code in ("ActiveX") command button as shown in code.
    Click button to hide duplicate rows (based on first 4 columns)
    Click button again to show hidden rows.
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    08-27-2019
    Location
    Philippines
    MS-Off Ver
    365
    Posts
    6

    Re: Hide Duplicate Rows using Macro

    Hi PaulSP8 and MickG,

    Sorry lacking details.
    For the table above, the data are auto generated by a software and
    I wanted to run the macro automatically once workbook is opened.
    Code should be placed in below.
    Attachment 639289

  5. #5
    Registered User
    Join Date
    08-27-2019
    Location
    Philippines
    MS-Off Ver
    365
    Posts
    6

    Re: Hide Duplicate Rows using Macro

    PaulSP8,

    The code works, but I need to manually run it.
    How to automatically run it when workbook is opened?
    I already tried placing the code in "ThisWorkbook" object.

  6. #6
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Hide Duplicate Rows using Macro

    You'd need to put the code in Workbook Open event, but to do that you'd need to open the Workbook, put in the code, close it (resaving as a macro enable file) and reopen it.

    So, you might as well just run the code manually?

    Alternatively you could add this something like this code to a button;

    Please Login or Register  to view this content.
    This would allow you to open the file and then run the hide macro on it.

  7. #7
    Registered User
    Join Date
    08-27-2019
    Location
    Philippines
    MS-Off Ver
    365
    Posts
    6

    Re: Hide Duplicate Rows using Macro

    Hi Paul, thank you.

    How about if I want to check values from column F - S if all the same
    with other rows?

+ 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] Macro to Hide Columns is Somehow Adding Duplicate Rows?
    By Jim Clayton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2018, 02:26 PM
  2. [SOLVED] Hide top duplicate rows
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2014, 06:35 AM
  3. Hide Duplicate Rows VBA
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 05:08 PM
  4. How to hide duplicate rows in excel 2003
    By allaud in forum Excel General
    Replies: 1
    Last Post: 02-20-2012, 03:35 AM
  5. Hide duplicate rows from filtered data
    By Arshmaan in forum Excel General
    Replies: 2
    Last Post: 10-28-2011, 06:37 AM
  6. Macro to hide/unhide rows using box then duplicate through sheet
    By BEEGINA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2011, 11:51 PM
  7. Hide duplicate rows
    By mshale in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-23-2010, 03:32 PM

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