+ Reply to Thread
Results 1 to 7 of 7

Need help with repeating macro - turning rows of data into columns

  1. #1
    Registered User
    Join Date
    11-13-2003
    Location
    California
    MS-Off Ver
    2013
    Posts
    37

    Need help with repeating macro - turning rows of data into columns

    Hello all! Need help trying to turn some output into something usable. I have multiple rows of data for each record, of which there are thousands of records. The key is the 'ID' field which is the last line of output. I was trying to come up with a way to have the ID inserted in the column next to the output and then try to figure out next steps. Ideally I'd like a column for each of the four data points but have no idea how to go about doing that

    Output:
    Submitted: "Y"
    Matched: "Y"
    Campus: "123"
    ID: 001
    Submitted: "Y"
    Matched: "Y"
    Campus: "123"
    ID: 002
    Submitted: "Y"
    Matched: "Y"
    Campus: "123"
    ID: 003


    My attempt but it stops after the first 2 sections of data. I was hoping it would keep working it's way down but it doesn't.
    ActiveCell.FormulaR1C1 = "=RIGHT(R[3]C[1],10)"
    Range("I7").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I8").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I9").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I10").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I11").Select
    ActiveCell.FormulaR1C1 = "=RIGHT(R[3]C[1],10)"
    Range("I12").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I13").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I14").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I15").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=R[-1]C"
    Range("I16").Select
    Attached Files Attached Files
    Last edited by bimmerman; 04-08-2022 at 06:30 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: Need help with repeating macro - turning rows of data into columns

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-13-2003
    Location
    California
    MS-Off Ver
    2013
    Posts
    37

    Re: Need help with repeating macro - turning rows of data into columns

    Quote Originally Posted by TMS View Post
    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Thank you, just updated the original post with a sample file!

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Need help with repeating macro - turning rows of data into columns

    Please Login or Register  to view this content.
    Notice I used code tags vs. your first post
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    11-13-2003
    Location
    California
    MS-Off Ver
    2013
    Posts
    37

    Re: Need help with repeating macro - turning rows of data into columns

    OMG you are amazing thank you so much for turning that around so quickly!!! That's exactly what I needed!!

    Once I have some time I'm going to really analyze and learn what you did there so I can be better with it next time!

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Need help with repeating macro - turning rows of data into columns

    Just for the fun of it...Another Option...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 04-09-2022 at 05:16 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Need help with repeating macro - turning rows of data into columns

    Further to Post #4.

    Attachment 776144

+ 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. [SOLVED] Moving Repeating Data from Rows to Columns (Not Transpose)
    By mifac in forum Excel General
    Replies: 6
    Last Post: 07-30-2021, 04:08 PM
  2. [SOLVED] semi repeating data in columns to arrange in rows
    By silvilalulu in forum Excel General
    Replies: 17
    Last Post: 09-04-2019, 05:02 AM
  3. Convert data from 3 rows to 3 columns repeating
    By vineeth.k11 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2019, 10:05 AM
  4. [SOLVED] Need help on macro to transpose rows to columns while repeating certain column N times
    By cmleong in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2016, 11:07 PM
  5. Replies: 9
    Last Post: 02-24-2015, 06:51 AM
  6. Replies: 7
    Last Post: 02-05-2015, 03:20 PM
  7. macro to detect last row of data and prevent rows from turning blue
    By Darel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2011, 05:29 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