VBA Code for pop-up list box to copy paste in different sheet

  • Hi Im new here, hoping to learn a lot about VBA


    I would like to create a command button code that will pop-up a list box listing all the sheets present in the workbook.

    For each selected sheet in the list box it will copy a specific column on selected sheet in listbox, and paste to a new sheet to a diffrent column



    Example

    I have Sheets - 'Block A', 'Block B', 'Block C', 'Block D'

    Press button - Listbox pop-up including all the present sheet in the book

    Select in list box - 'Block A', 'Block B', 'Block D' only

    Column to copy for each - C:C

    New Sheet to be generated - 'Building A'

    Now Each Column C:C copied will be pasted to Sheet 'Building A' on different column with interval of 2 columns each

    so it will look like

    Building A Sheet's:

    Column A - contains Column C:C of Block A

    Column D - contains Column C:C of Block B

    Column G - contains Column C:C of Block D



    ...and so on depending on number of sheets ticked in the list box.

  • It would be easier to help if you could attach a copy of your file (de-sensitized if necessary).

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • It would be easier to help if you could attach a copy of your file (de-sensitized if necessary).

    Like This, the sheet contains say A Building 1, for this building we have 4 blocks, A, B, C, and D
    I need a button that will pop-up a listbox listing all the current worksheets (A, B, C, and D, in this case) if I add another worksheet it will also be on the list, then all those selected in listbox, will copy the Column I , of each selected worksheet. (Formula column in this case). and Paste it to a New Generated Worksheet (through button too) so the New Generated Sheet will contain the same Column A:F , then for Column I:I and so on will have the the copied value from selected sheets in listbox

    example
    I selected Blocks A, B, and D in the popped up listbox
    new generated sheet will contain

    A:F column of the sheet as it is all the same
    Then for Column I , it will contain the column I of sheet Block A
    then 2 intervals so Column L will contain the Column I of sheet Block B

    then another 2 interval, Column O will contain the column I of sheet Block D

    I have included a sample worksheet on how its supposed to look like when selecting A B D

  • You are very welcome. :)

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!