+ Reply to Thread
Results 1 to 3 of 3

Code to group rows with the same time value?

  1. #1
    Registered User
    Join Date
    12-24-2014
    Location
    la, usa
    MS-Off Ver
    2003
    Posts
    22

    Code to group rows with the same time value?

    In a nutshell, here's what I have:

    Column A: Start Time
    Column B: End Time

    The macro I have so far first sorts all entries according to each column and then inserts a row between each entry. What I would like for it do after this is to group entries with the same Start and End times together (i.e. no rows between them.) Any suggestions?

    P.S. the code I'm using at this point inserts the rows one by one like so:

    Please Login or Register  to view this content.
    I suspect there's a more efficient way of doing it, though.
    Last edited by bvercher; 03-03-2015 at 09:52 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Code to group rows with the same time value?

    This inserts a new row whenever column A or B does not match - add this to your sorting routine, since it does not sort.

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 03-03-2015 at 10:36 AM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    12-24-2014
    Location
    la, usa
    MS-Off Ver
    2003
    Posts
    22

    Re: Code to group rows with the same time value?

    Perfect! Thank you so much!

+ 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. Help with VBA code for selecting Multi Rows in Subtotal Group
    By isisisis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2014, 07:34 PM
  2. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  3. [SOLVED] Need VBA code to count number of rows & split into group of 7 rows in same sheet
    By amy_d2 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-05-2013, 11:03 AM
  4. Replies: 0
    Last Post: 07-15-2009, 01:17 PM
  5. [SOLVED] VBA Code to Group Rows Based on Cell Contents
    By Pliskers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2006, 03:29 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