Consulting

Results 1 to 2 of 2

Thread: Help with coding for labels

  1. #1
    VBAX Regular
    Joined
    Jul 2016
    Posts
    14
    Location

    Help with coding for labels

    I need a bit of help with writing a code in excel.

    I have a spreadsheet like the one below. What I would like to do is to copy the data from 4 cells into 1 cell with spaces in-between onto a new list (list 2) so that it would be populated as such:

    A6: 1 P1 1 1 (or as transcribed from list 1: A3 B3 A4 B4)
    A7: 1 P1 2 2 (or as transcribed from list 1: A6 B6 A7 B7)
    A8: 2 P1 1 3 (or as transcribed from list 1: C3 D3 C4 D4)
    A9: 2 P1 2 4 (or as transcribed from list 1: C6 D6 C7 D7)
    A10: 3 P1 1 5 (or as transcribed from list 1: E3 F3 E4 F4)
    A11: 3P1 2 6 (or as transcribed from list 1: E6 F6 E7 F7)
    A12: 1 P2 1 7 (or as transcribed from list 1: A9 B9 A10 B10)
    A13: 1 P2 2 8

    and so on,.... the thing is that the table can be much bigger depending on the numbers populated in A4, A7, A10,... (everytime 3 rows lower) and these numbers repeat based on the number of periods (P1, P2, P3,....), and the number of columns depend on the number of subjects in A3, C3, E3, G3, ... (everytime 2 cells to the right). the numbers that are the most important are bolded. They scale from subject 1 in Period 1 (P1) to the last subject in P1 and then continue scaling from subject 1 in Period 2 to the last subject in Period 2 and so on in Period 3 and Period 4,.... so what I would need is a macro button to click and the data from this table would be trasfered onto a new list as described above.
    A B C D E F
    1
    2
    3 1 P1 2 P1 3 P1
    4 1 1 1 3 1 5
    5
    6 1 P1 2 P1 3 P1
    7 2 2 2 4 2 6
    8
    9 1 P2 2 P2 3 P2
    10 1 7 1 9 1 11
    11
    12 1 P2 2 P2 3 P2
    13 2 8 2 10 2 12
    Last edited by Mikroicy; 10-13-2017 at 12:15 AM.

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    can you post your workbook?
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •