Consulting

Results 1 to 2 of 2

Thread: Copy Columns in Selected Sheets to a New Table with the data

  1. #1

    Copy Columns in Selected Sheets to a New Table with the data

    Hi,

    I am looking for a macro that can copy columns in selected sheets:

    Copy Columns (A, B, D) in selected Sheets in the workbook and create a new sheet with the data.

    The Data should be pasted from Column A and to the right.
    For each new sheet copied there should be inserted an empty column.

    Thank you in advance for the help

  2. #2
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    362
    Location
    Hi Christian,

    I don't have the code for this to hand, but these pointers should give you the words to look up.

    1: create a new worksheet. do this by setting a worksheet object. I believe the code is:
    dim newSheet as worksheet
    set newSheet = thisworkbook.worksheets.add
    now you can call this sheet at any time by "newworksheet.range("A1")" etc.

    2: copy and paste columns

    you can use copy/paste in vba (there is lots on this in this forum and elsewhere on google)
    you can also use the macro recorder to record a copy/paste event to get some workable code - all you would then need to do is manage the ranges you copy and paste to and from.

    hope this gives you a start
    Remember: it is the second mouse that gets the cheese.....

Posting Permissions

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