+ Reply to Thread
Results 1 to 4 of 4

Remove Blank Cells and Sequential Series to Compact List of Elements

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Las Vegas
    MS-Off Ver
    Office 7
    Posts
    2

    Remove Blank Cells and Sequential Series to Compact List of Elements

    Hello,

    I am new to this forum looking for some assistance to help me write code to remove blank spaces and condense sequential elements into a short hand the schema of which can be seen in the snippet below and in the workbook sheet attached. Essentially, using this shorthand schema, when more than two elements are sequential in the list the intermediate values are omitted and the first and last in the series is separated by “ TO ” where individual elements and compacted sub-lists of sequential elements are separated by spaces.

    Example Element by Element List

    68052 68055 68064 68065 68066 68079 68080 68081 68082 68083 68111 68112 68113 68126 –
    68127 68128 68129 68130 68158 68159 68160

    Resulting Compacted List
    68052 68055 68064 TO 68066 68079 TO 68083 68111 TO 68113 68126 TO 68130 –
    68157 68159 68160

    Ultimately, what is required is to process each column of data captured from a separate analysis and write the compacted list back to the sheet to be used in the next analysis iteration. The number of columns is variable as are the number of rows from one analysis to the next so a dynamic array would seem to be the appropriate choice here but not absolutely required. Lastly, each row from the compacted list may be not more than 77 characters wherein it must continue to next line with a space and a dash “ –“ which cannot occur before or after the “TO” ( e.g. the sub-lists cannot be split at end of line).

    Sadly, I have exhausted my limited resources for array processing, nested arrays and DO loops and am at an impasse. Moreover, I am unable to web mine any VBA code snippets similar enough to scavenge for this purpose. Any assistance (even a helpful nudge in the right direction) would be greatly appreciated and thank you in advance for any assistance you may provide. Please note that although I have stated the problem in its entirety, it is not expected that someone will invest all the time necessary to provide a comprehensive code solution to the problem in its entirety and partial solutions to any and all parts are welcomed and appreciated.
    Attached Files Attached Files

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

    Re: Remove Blank Cells and Sequential Series to Compact List of Elements

    See if this is what you wanted.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Las Vegas
    MS-Off Ver
    Office 7
    Posts
    2

    Re: Remove Blank Cells and Sequential Series to Compact List of Elements

    Jindon,

    Thank you very much for response, the code works flawlessly.

    Your reputation is well deserved and I am humbled by your abilities.

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

    Re: Remove Blank Cells and Sequential Series to Compact List of Elements

    You are welcome and thanks for the rep.

+ 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: 9
    Last Post: 11-23-2016, 12:22 PM
  2. Replies: 3
    Last Post: 06-14-2014, 03:05 PM
  3. Replies: 5
    Last Post: 08-26-2013, 06:26 PM
  4. [SOLVED] Not able to remove blank cells in new list keeps repeating same item?
    By omallyfoster in forum Excel General
    Replies: 2
    Last Post: 05-21-2013, 02:16 PM
  5. [SOLVED] Remove blank cells from the list
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2012, 01:51 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