+ Reply to Thread
Results 1 to 11 of 11

Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

  1. #1
    Registered User
    Join Date
    09-07-2014
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    6

    Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    Hi, new to writing Macros here so I was wondering if someone might be able to give me some tips on the following. I am using Excel 2010 on a Windows 7 PC.

    I am trying to get some LMS data where currently a single question takes up 4 rows and the correct answer is always in the first row for each question designated by a 1 in the CORRECT column transposed into a format where each question and its respective possible answers are in the same row and the position of the correct answer is randomized instead of always being in first or (A ) position of a multiple choice answer. At the moment the data looks like the following:

    startingformat.jpg

    I need it structured like the following where the answer is designated as Correct by either having a TRUE or FALSE next to it in a single row for each questions :
    endingformat.jpg
    Any help or ideas would be greatly appreciated.

    Thanks! Bob

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520
    Example workbooks are better then pictures. Nobody wants to recreate a workbook from pics.

    On another sheet you can show the expected results from a macro.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-07-2014
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    Sure, I think I included it in the original post with the screenshot call endingformat.jpg

    Here it is: http://www.excelforum.com/attachment...dingformat.jpg

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    What I'm saying is your better off uploading an actual workbook NOT a a picture

  5. #5
    Registered User
    Join Date
    09-07-2014
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    OK, Sorry about that. Here they are:

    Starting Spreadsheet; StartingFormatExample.xlsx

    Resulting Format: ResultingFormatExample.xlsx

    In each Row, the position of the TRUE value and it's associated answer in the next column to the left should be randomized between across the following columns:

    MULTIPLE_ANSWER_1_CORRECT__C MULTIPLE_ANSWER_1__C MULTIPLE_ANSWER_2_CORRECT__C MULTIPLE_ANSWER_2__C MULTIPLE_ANSWER_3_CORRECT__C MULTIPLE_ANSWER_3__C MULTIPLE_ANSWER_4_CORRECT__C MULTIPLE_ANSWER_4__C

  6. #6
    Registered User
    Join Date
    09-07-2014
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    Here are two better examples of the actual spreadsheet starting and resulting formats.

    Starting Format: StartingFormatExample2.xlsx http://www.examzone.com/resource/StartingFormatExample

    Resulting Format: ResultingFormatExample2.xlsx http://www.examzone.com/resource/ResultingFormatExample

    These are an exact match that I prepared manually so hopefully that makes it clearer

    Thanks! Bob
    Last edited by bwalks; 09-07-2014 at 06:16 PM.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    See attached workbook.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-07-2014
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    Mike,

    This is great. I noticed the macro inserted the TRUE or Correct answer into both rows at position 4 or answer 4. Is that because the data set was so small?

    Thanks! Bob

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520
    Run the macro again and see

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...ame-macro.html
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Registered User
    Join Date
    09-07-2014
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    6

    Re: Transpose Multiple Rows into a Single Row and Randomize in the Same Macro

    Mike,

    I ran it with 25 questions and it is completely randomized, it works great!

    Thank you so much!

    Regards, Bob

+ 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. Transpose multiple rows of data to a single row
    By dansteg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2014, 03:09 PM
  2. [SOLVED] Transpose multiple rows to single row
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2014, 04:59 AM
  3. Transpose Multiple Rows into a Single Column
    By vnascimento in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2013, 08:47 AM
  4. Replies: 5
    Last Post: 05-25-2013, 07:12 AM
  5. Transpose multiple rows into 1 single row dependent on name
    By Angiec50 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2012, 03:30 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