+ Reply to Thread
Results 1 to 14 of 14

Removal of multi lines via macro

  1. #1
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    Office Pro 2010
    Posts
    275

    Removal of multi lines via macro

    Hi All

    I have a dilemma.

    I need to be able to hide multi customer lines within a spreadsheet via a macro. Ive uploaded a sample.
    The macro needs to look at a column and then hide any multi customer lines it finds

    In the sample the offending multi customer is Interactive. I know this is a multi as in column B, B3 is blank which would indicate it is the same load number as B2 and therefore needs to hide/filter out lines 2 & 3

    Hope ive explained it well enough
    Attached Files Attached Files
    Last edited by ukphoenix; 05-24-2020 at 12:11 PM.

  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: Removal of multi lines via macro

    Here's a hide and recover tandem:

    Please Login or Register  to view this content.
    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
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Removal of multi lines via macro

    Another option
    Please Login or Register  to view this content.
    This will toggle between hiding & unhiding.

  4. #4
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    Office Pro 2010
    Posts
    275

    Re: Removal of multi lines via macro

    Quote Originally Posted by Fluff13 View Post
    Another option
    Please Login or Register  to view this content.
    This will toggle between hiding & unhiding.
    Thanx, this seems to be the easier code to use and does hide the blank line in question (line 3), but it also needs to hide the first line of the multi with the order number on it aswell (line 2)

    Attachment 679240
    Attachment 679241

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

    Re: Removal of multi lines via macro

    Thanks for the rep!:

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Removal of multi lines via macro

    Expanding on Fluff13's "no loop" idea...
    Please Login or Register  to view this content.
    Note: We cannot use Fluff's "Not .Hidden" idea in case the last cell in Column B is blank, so you will still need separate code to unhide all the rows (as xladept offered).
    Last edited by Rick Rothstein; 05-24-2020 at 02:15 AM.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Removal of multi lines via macro

    Quote Originally Posted by ukphoenix View Post
    it also needs to hide the first line of the multi with the order number on it aswell (line 2)
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    Office Pro 2010
    Posts
    275

    Re: Removal of multi lines via macro

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    Can you elaberate on your code as I cant seem to get it to work. Keeps debugging at 'With Union' line
    The code below is what was supplied by Fluff13 with a few modifactions and indeed does hide the lines with the blank cells but with all the coding supplied cant see how to alter it to hide the line above the blank.

    Any help of rewrite would be appreciated

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Removal of multi lines via macro

    How about
    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Removal of multi lines via macro

    See................
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    03-23-2007
    Location
    Essex, UK
    MS-Off Ver
    Office Pro 2010
    Posts
    275

    Re: Removal of multi lines via macro

    Thanx Fluff13, Jindon working.

  12. #12
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Removal of multi lines via macro

    Quote Originally Posted by Rick Rothstein View Post
    Expanding on Fluff13's "no loop" idea...
    Please Login or Register  to view this content.
    Note: We cannot use Fluff's "Not .Hidden" idea in case the last cell in Column B is blank, so you will still need separate code to unhide all the rows (as xladept offered).
    I was wrong when I said we cannot use Fluff13's idea... I implemented it incorrectly. Fluff13 used Column B and I changed it to an offset from Column A. If we use his original Column B suggestion, this is how my version of his code, expanded to hide the row above the blank as well, would look...
    Please Login or Register  to view this content.

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Removal of multi lines via macro

    You're welcome & thanks for the feedback.

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Removal of multi lines via macro

    You are welcome.

+ 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] Apply multi fields in 1 line instead of doing it on several lines
    By countryfan_nt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2017, 11:44 AM
  2. Separating lines from multi-line Excel cell
    By podship in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2016, 03:19 AM
  3. [SOLVED] Separating lines from multi-line Excel cell
    By ymredzu in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-24-2013, 11:42 AM
  4. Pivot Table/Removal of Total Lines
    By JTPhillips in forum Excel General
    Replies: 3
    Last Post: 06-13-2012, 02:44 PM
  5. Excel 2007 : VLookup date range and return multi lines
    By rik1603 in forum Excel General
    Replies: 1
    Last Post: 02-18-2010, 11:04 AM
  6. Divider lines in multi column list boxes?
    By waltron in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2009, 06:53 PM
  7. Removal of lines
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 01-09-2006, 05:40 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