+ Reply to Thread
Results 1 to 16 of 16

Compile Sheets Contents

  1. #1
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9

    Compile Sheets Contents

    Hi there,

    I am a new user to excel and have searched the forum for an answer..

    Have tried a few things but can't get it to work properly. I have attached the file I am working with because it is much easier to understand if you just look at it!

    Basically, I have a single sheet with three columns:

    Name, Post Code, Tenant

    There are varying instances of 'Name' and each one has a different 'Tenant'.

    What I need to do is merge the contents of the Tenants cells so that for each different 'Name' there is only 1 instance and then for Tenants all the different cells are merged i.e. "Tenant 1, Tenant2, Tenant3...etc"

    I hope this makes sense, as I mentioned above it will be a lot clearer if you have a quick look at the attached spreadsheet.

    Thanks for any light you may be able to shed on the subject...

    Ash
    Attached Files Attached Files
    Last edited by ashpuk; 10-06-2008 at 11:42 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, Do you mean you want to merge all the tenants relating to a single "Name" in one cell, or do you want to place them in single cells in the row, relating to that tenant.
    In essence transpose each individual "Name" in its own row with all its Tenants
    What about the "Post Codes" ???
    Regards Mick

  3. #3
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    Hi Mick, thanks for your reply,

    I want to get the list so that there is only one instance of each "Name".

    At the moment a "Name" may be repeated 5 times if there are 5 different "Tenants" associated with that name.

    EG:

    In my attached file, 28 East Retail Park is repeated 9 times for each different retailer on the park.

    I want to compile all the tenants so that 28 East Retail Park is only listed once and then the tenants cell displays "JJBSportsSuperHealth, CometSuperstore, VacantNew, AlliedCarpets..etc"

    The Post Code is the same for each retail park so this should not really be an issue.

    Hope this makes sense? - Please let me know if not,

    Thanks

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    You could do something half-decent with a pivot table, but here is some code:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, Please find Attached your file returned:-
    I've copied the Data to Sheet (2) and Transposed it in sheet (3)
    See Macro Button on sheet (2)
    Regards Mick
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    Mate, that is amazing

    I quick question though - is there anyway we can get all the tenants into 1 cell and separate them by a comma? Also how would you keep the postcode column?

    I have had a look at the VB Code but dont really understand it

    Otherwise that is spot on - THANKS!!

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Are you saying the code is spot on or you don't understand it so you haven't tried it?

  8. #8
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    Sorry that reply was to MickG,

    Have just tried your code and that also works great too. Only problem is that it does not include the postcodes in the results? Think that is my fault because of confusing post before..

    What would you add to your code to include postcodes? cheers

  9. #9
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi Try this, File format as Before.
    Regards Mick
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Just change line below as follows:
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    Steve - sorry to be a pain, just changed the line of code as you suggested and it outputs the postcode in the same cell as the scheme - I need the postcode to be in a separate cell I'm afraid.

    Thanks so much for ur help!

  12. #12
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    Sorry mick, just got onto your response too. It works great but when I try and do it for the full list it says out of memory. Hopefully if steve comes back to me it should be sorted now anyway!

    Thanks so much for your help it is massively appreciated!

  13. #13
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Try this:
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    cheers mate that is perfect

  15. #15
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    Hi Sorry to reopen the thread but I have just realised that i cannot export the data that SteveR's code generates. I get error message saying:
    'The information cannot be pasted because the Copy area and the paste area are not the same size and shape'.

    Whats going on?!

    Thanks

  16. #16
    Registered User
    Join Date
    10-06-2008
    Location
    UK
    Posts
    9
    sorry again - me being stupid! got it working, thank you so much

+ 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. Create pivot automatically in all the sheets based on the data in sheets
    By aravindhan_31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2008, 11:59 AM
  2. SUMPRODUCT across Multiple Sheets in the same workbook
    By Adrian17 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-23-2007, 01:41 PM
  3. Printing Multiple Sheets to One PDF file
    By johnnywinter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2007, 11:03 AM
  4. Table of contents for contents of 1 sheet
    By dhbyrne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-15-2007, 06:39 PM
  5. How to reference cells in Next/Prev Sheets automatically?
    By theouaegis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-13-2006, 01:56 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