+ Reply to Thread
Results 1 to 7 of 7

Align rows comparing multiple columns

  1. #1
    Registered User
    Join Date
    09-17-2010
    Location
    Cincinnati, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Align rows comparing multiple columns

    Hi,

    I need to know if there is a way to align rows from multiple columns in excel. I have attached a sample spreadsheet if it helps to understand my question. Column A is my standard data (these are masses of peptides), Column B, C and D are experimental masses that I have from three experiments. I need to treat these questions routinely but I am frustrated to have to do this manually. I need your input and help.

    I have read some post regarding this similar question, but mine is even more challenging: you probably already noticed that all my numbers have four decimal points so there is actually no identical numbers in any of the columns/rows. I need to align those numbers within a certain mass range: +/-0.2000 (ideal condition) to my standard data. And all of the columns have different number of rows.

    Could someone tell me whether the task is possible by running a Macro? If so, how to solve?

    Thanks a lot!
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Align rows comparing multiple columns

    Welcome to the forum.

    So the results should look, in part, like this?
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-17-2010
    Location
    Cincinnati, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Align rows comparing multiple columns

    Thanks, shg.

    Yes, I wanted to align my data like what you showed (partly). Is there a macro to perform this function?

    Thanks!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Align rows comparing multiple columns

    Unzip the attachment and put it in the desktop (or elsewhere).

    Open the workbook and drag it into the VBA project.

    For the example you posted, select A1:D1, and in the Names box (left of the formula bar) enter keys

    Run macro AlignKeys.
    Attached Files Attached Files
    Last edited by shg; 09-20-2010 at 06:30 PM. Reason: And now, with the attachment ...

  5. #5
    Registered User
    Join Date
    01-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Align rows comparing multiple columns

    Thanks SHG you have saved me hours of work!

  6. #6
    Registered User
    Join Date
    10-13-2012
    Location
    bend oregon
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Align rows comparing multiple columns

    will this "alignkeys" work with Excel 2010? is this the correct macro for waht I need to accomplish? see attachment sample.lots of data to to align....help is appreciated

    I am attaching a sample of what i need to accomplish.data question.xlsx
    Last edited by jacksage; 10-13-2012 at 04:09 PM.

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Align rows comparing multiple columns

    jacksage,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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