Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Queensland, Australia
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi
    I have a workbook which has 2 worksheets and I was hoping there is some way that I can automatically (maybe using a macro) merge selected sections from the one sheet into the relevant section in the other worksheet.

    For example
    In the main worksheet I have 4 sections each with their own heading under which I have several rows of data. In the second worksheet I have the same sections with the same headings also with various rows of data.

    Once a month I want to copy all the rows of data in a particular section from Worksheet 2 and paste them in the same section on worksheet 1 and repeating this for each other section.

    Currently I do this manually by cutting and pasting but was hoping it might be able to be done possibly using a macro or some other way.

    Here's hoping someone not only can make sense of this but also suggest a way of doing it

    Thanks

    Dax
    Dax


  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Dax,

    Yes this is very doable via VBA {macro}. Could you answer a couple of questions?
    1. The data you are copying from sheet2 is it deleted from sheet2 after copying to sheet1?
    2. Are the sections in both sheets laid out vertically or horizontally, e.g. is section 2 under or to the right of section 1.

    It would be very helpful if you could upload a sample workbook with, if necessary, sterilized data.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,829
    Thanks
    136
    Thanked 482 Times in 459 Posts
    Essentially, you are 'appending' the data from one worksheet to another.
    I would use the 'sorting capability to align data into it's corresponding section.

    Basically, what you do is use a 'spare' column on both sheets (I would call it 'sortCol')
    Then, by judicious numbering in this sort col, (e.g. 1.0, 1.01, 1.02, .., 4.0, 4.01, 4.02 etc), you could just copy and paste the whole block from sheet 2 to bottom of sheet 1, then use the sortCol to sort the rows into their correct section etc.
    Then delete the 'duplicate' section heading titles.

    zeddy

  4. #4
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Queensland, Australia
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    Sorry for the delay in replying, I have been away with work and not able to access the Net.

    Below is further information as requested and to assist with this request I have uploaded a sample workbook to my Google docs site at:
    My linkhttps://docs.google.com/leaf?id=0B2R7hkuu2v2XZTQyMTIxNDYtZjVhZC00YzlmLTljM GUtMWZjN2MyZmRmZWVh&hl=en&authkey=CO7y9qIN

    The workbook contains 3 separate worksheets which are managed my separate individuals. On a monthly basis I need to combine the 3 worksheets into a new worksheet within the same workbook (while still keeping the original 3 worksheets). Currently I do this by cutting and pasting each section.

    Within each worksheet there are several headings/sections, i.e.:
    Green
    Skilling
    Literacy
    PiP
    Places
    Get Set

    I need all the data in each heading/section combined under the new worksheet under the relevant section.

    My preference would be for a macro that I could assign to a tool on the toolbar/ribbon that I could use to do this function.

    Is this possible or is there a different way I could set up the worksheets to achieve the same outcome.

    I look forward to your response

    Cheers

    Dax
    Dax


Posting Permissions

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