+ Reply to Thread
Results 1 to 3 of 3

Align and insert rows based on reference column

  1. #1
    Registered User
    Join Date
    02-06-2012
    Location
    Woodbridge, NJ
    MS-Off Ver
    Excel 2007
    Posts
    1

    Align and insert rows based on reference column

    Hi Everyone,

    I have an excel spreadsheet in which I have inserted a reference column (A) and would like to horizontally align column B through column D, inserting empty rows as needed. In this example, 112 in the Number column would be moved down one row. This one has really stumped me. Can an Excel genius who sees this help? Thanks!

    Here's an example:

    REF Number Category Class
    111 112 B D
    112 113 A C
    113 114 C B
    114 123 B B
    121 131 F O
    122 133 G Y
    123 221 C C
    131 231 E U
    132 212 A C
    133 221 R T

  2. #2
    Registered User
    Join Date
    02-22-2010
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Align and insert rows based on reference column

    Maybe not the best at this, but I whipped this up real quick for you.


    Please Login or Register  to view this content.
    Simply put, this checks if Column A is smaller than Column B (and A is not empty), and if so, pushes the row down one.

    Since the size of the range will change, I set it up so it checks 100 rows, but you can change that to a higher number as needed, or 65536 (excel 2003 limit) to get everything.
    Last edited by Franck Knight; 03-27-2012 at 03:44 PM.

  3. #3
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Align and insert rows based on reference column

    A simple change that will check up to the used range, updated at each step:

    Please Login or Register  to view this content.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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