+ Reply to Thread
Results 1 to 9 of 9

Align Rows Comparing Multiple Columns

  1. #1
    Registered User
    Join Date
    08-29-2008
    Location
    usa
    Posts
    22

    Align Rows Comparing Multiple Columns

    Hi,
    I would like to align rows in an spreadsheet. The spreadsheet has multiple columns which has data which needs to be aligned. I have added a spreadsheet with 2 tabs . One is input tab and the other is output tab. I would like to get the data formatted in the input tab to the one which looks like in output tab.

    I would like to run a macro to get the output, the number of rows in each column are not fixed. they change depending upon the data.

    Thanks in Advance.
    Attached Files Attached Files
    Last edited by VBA Noob; 10-19-2008 at 09:20 AM. Reason: Making clear about my question

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Here is one approach. Select the cells on sheet1 and results placed in sheet2.
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    Here's an alternative; it's a generic sorting routine that will produce output for any matrix of data in an active sheet and sort by numbers, then capital letters then lower case letters ... and displays the linear list of values in a column to the right of your data and also the 2 dimensional sorted matrix underneath your data.

    Please Login or Register  to view this content.
    Hope that helps. MM.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  4. #4
    Registered User
    Join Date
    08-29-2008
    Location
    usa
    Posts
    22

    Smile

    Thanks for the macro. but I think my question was not clear. The data I provided in my post little bit more complicated then what i mentioned in the post. For easy understanding i am giving a link to the excel file. There are 2 tabs in the spreadsheet. I says input and the other one is output tab. I would like to have a macro which gives me the output as described in the output tab. here is the link for the spreadsheet.

    thanks
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    OK - an attachment always helps My question is: Is the first ID for each set of data unique within the individual data? That is, for each dataset SP1, SP2, SU1 etc .. can there ever be two ID_id1 values the same? Such as - having ID_id1 = 40_1 twice, with different combinations of the other IDs (ID, id1, id2)?

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    The second example doesn't appear to bear any relation to the first, or at least I can't detect it. I'll leave it to you MatrixMan!

  7. #7
    Registered User
    Join Date
    08-29-2008
    Location
    usa
    Posts
    22
    yes, The first column is unique. No ID_id1 it should not have any duplicate values. The first column is the concatenation of ID and id1. There are no other possibilities. I would like to align all other datasets based on this ID. hope this helps. Thanks

  8. #8
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    Hi deaerator ... OK, I think this will do what you're after. The code is below; just paste it into the workbook object, and I've attached the workbook I used to test it. This is the main control module:
    Please Login or Register  to view this content.
    And these are the others the control module calls:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Hope that helps. MM.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-29-2008
    Location
    usa
    Posts
    22

    Smile

    Thank You MM. Works like a charm. Thanks so Much...
    Last edited by deaerator; 10-19-2008 at 11:16 AM.

+ 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. Sumif or Sumproduct with Multiple Rows & Columns
    By vulches in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-12-2017, 02:06 AM
  2. Transpose multiple columns into one column
    By longfisher in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-13-2011, 10:44 PM
  3. Selecting multiple columns
    By yonyon7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2008, 05:58 PM
  4. Comparing Columns and Deleting values
    By oneblueaugust in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-06-2007, 02:43 PM
  5. Compare columns and deleting multiple rows
    By chom in forum Excel General
    Replies: 3
    Last Post: 06-09-2007, 02:53 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