+ Reply to Thread
Results 1 to 5 of 5

Insert Rows and Transpose Data: Macro or Formulas?

  1. #1
    Forum Contributor
    Join Date
    02-16-2010
    Location
    Manchester, England
    MS-Off Ver
    Microsoft 365 for Enterprise
    Posts
    108

    Insert Rows and Transpose Data: Macro or Formulas?

    Hi All, Happy New Year! :D

    I think it's a macro i need but it might well be achievable by a set of functions?

    I have been asked to provide a list looking like this:

    Person Warehouse StockRole
    Person 1 EBWALL Administrator
    Person 1 ECOMPD Administrator
    Person 1 ECOSHH Administrator
    Person 1 EGENTR Administrator
    Person 1 EJ4RCK Administrator
    Person 1 ELOCKR Administrator
    Person 1 EMRACK Administrator
    Person 1 EPAINT Administrator
    Person 1 EROOFS Administrator
    Person 1 ESTORE Administrator
    Person 2 EBWALL Stock Manager
    Person 2 ECOMPD Stock Manager
    Person 2 ECOSHH Stock Manager
    Person 2 EGENTR Stock Manager
    Person 2 EJ4RCK Stock Manager
    Person 2 ELOCKR Stock Manager
    Person 2 EMRACK Stock Manager
    Person 2 EPAINT Stock Manager
    Person 2 EROOFS Stock Manager
    Person 2 ESTORE Stock Manager
    Person 3 EBWALL Read Only
    Person 3 ECOMPD Read Only
    Person 3 ECOSHH Read Only
    Person 3 EGENTR Read Only
    Person 3 EJ4RCK Read Only
    Person 3 ELOCKR Read Only
    Person 3 EMRACK Read Only
    Person 3 EPAINT Read Only
    Person 3 EROOFS Read Only
    Person 3 ESTORE Read Only


    But because i have aprox 15000 entries in the Person column, with a single row for each, I would have to Insert the additional 9 rows against each name and add the 10 Warehouse entries and populate the Stock Role column against each. The Stock Role is the same against every warehouse against any given Person name, but differs for a different Persons.

    The format I can create easily is this:

    PersonnelName UserClass StockRole EBWALL ECOMPD ECOMPD ECOMPD ECOMPD ECOMPD ECOMPD ECOMPD ECOMPD ECOMPD
    Person 1 Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator
    Person 2 Helpdesk Stock Manager Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator
    Person 3 Senior Operative Read Only Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator Administrator


    Please see attachment for better laid out example.

    Is there a way to create the first from the second or from the 'rules' that avoids a manual exercise repeated 15000 times?

    thanks in advance!

    Jason
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Insert Rows and Transpose Data: Macro or Formulas?

    with Power Query

    Please Login or Register  to view this content.
    see attachment, is that what you want?
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2508 Build 16.0.19127.20082) 64-bit
    Posts
    31,733

    Re: Insert Rows and Transpose Data: Macro or Formulas?

    in A3

    =INDEX($I$3:$I$5,INT((ROWS($1:1)-1)/10)+1)

    in B3

    =INDEX($L$2:$U$2,,MOD((ROWS($1:1)-1),10)+1)

    in c3

    =INDEX($K$3:$K$5,INT((ROWS($1:1)-1)/10)+1)
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    435

    Re: Insert Rows and Transpose Data: Macro or Formulas?

    And here's a VBA solution. I made your output into an Excel table as it's easier to manage.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,987

    Re: Insert Rows and Transpose Data: Macro or Formulas?

    Another option if you have the new functions is
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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 rows to column and insert new rows to fill in data
    By Apple Ling in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2019, 04:02 AM
  2. VB Code or macro to insert 32 new rows with data and formulas
    By kmham in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2015, 10:29 AM
  3. [SOLVED] MACRO to insert rows and transpose values into new rows.
    By b3ntran in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-30-2014, 02:17 AM
  4. [SOLVED] Macro with text to columns, insert rows, and paste special>transpose
    By diaphanous1138 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-22-2013, 02:49 PM
  5. [SOLVED] Need Help w/Macro that Insert Rows, Copy Row, and Transpose to Column
    By hiroki3296 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2012, 10:27 AM
  6. [SOLVED] Insert Rows and Transpose Data
    By sks262 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-10-2012, 01:29 AM
  7. Insert rows, transpose data from column in to rows, in steps
    By mchevalier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2012, 08:14 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