+ Reply to Thread
Results 1 to 10 of 10

Creating List of Data from Multiple Worksheets

  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Question Creating List of Data from Multiple Worksheets

    I am trying to create a list of residents, unit types, and unit numbers. I have 3 problems with the following code.

    1) The code ignores sheets that have no value in the specified cell. I need it to return a blank cell for those in order to keep the data in each column matched with the sheet it came from.
    2) The code includes data from hidden sheets. I only want to list data from unhidden sheets. And more specifically, I want to omit data from unhidden sheets that have their tab colored black.
    3) The code includes data from the sheet named "Totals" which I thought I was telling it to ignore.



    Please Login or Register  to view this content.
    Last edited by narrowgate88; 05-18-2009 at 09:38 AM.

  2. #2
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Creating List of Data from Multiple Worksheets

    Hi there!

    I appreciate the details which you have posted here. It doesn't look like the code is giving a logical conclusion. You have run the For Each loop three times. Or I am unable to understand anything. It would be really great if you can attach the file here.

    If the file is heavy, you can send it @ my email id : [email protected]

    After looking at the file, I can find out the possible solution for your problem.

    Thanks,
    Vikas

  3. #3
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Creating List of Data from Multiple Worksheets

    My file had tons of private info in it, so here is a small version of it after replacing all the private info.

    I don't mind if I need to add an additional column of "sheet names" to the summary sheet, in order to get the info on the right line, because I can add code to delete that out later.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Creating List of Data from Multiple Worksheets

    3) Your sheet name is "TOTALS" (uppercase) which is not the same as "Totals" so the macro will copy the data from the TOTALS spreadsheet, that's why
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Creating List of Data from Multiple Worksheets

    I am really not sure about your first problem. However, your other two problems are solved in the following code. If you can explain the first query, I can help you then.

    Please Login or Register  to view this content.
    HTH

  6. #6
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Creating List of Data from Multiple Worksheets

    Hadn't thought about the case issue, so thank you. This code did work to ignore the hidden sheets, but it didn't ignore the sheet with a black tab. Is there a way to do that?

    As for the first issue, I am wanting to have a list that says Unit Type, Unit Number, and Resident. I need each column in the row to have come from the same sheet. Right now, because some sheets have no value in one of the cells, it is producing a result that has the wrong resident listed with a particular unit. Does that help clarify?

  7. #7
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Creating List of Data from Multiple Worksheets

    Quote Originally Posted by narrowgate88 View Post
    Hadn't thought about the case issue, so thank you. This code did work to ignore the hidden sheets, but it didn't ignore the sheet with a black tab. Is there a way to do that?

    As for the first issue, I am wanting to have a list that says Unit Type, Unit Number, and Resident. I need each column in the row to have come from the same sheet. Right now, because some sheets have no value in one of the cells, it is producing a result that has the wrong resident listed with a particular unit. Does that help clarify?
    Hi,

    yes, that has made your problem clear. However, (in the same file which you attached earlier) produce a sample output which you want to obtain, it will certainly help me to solve the problem.

    Thanks,
    Vikas

  8. #8
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Creating List of Data from Multiple Worksheets

    Result would look like this:

    Row 1 = A=Duplex B=Unit 195 C=Resident 1
    Row 2 = A=blank B= Unit 198 C=Resident 2
    Row 3 = A=Duplex B=Unit 104 C=Resident3
    Last edited by narrowgate88; 05-14-2009 at 09:51 AM. Reason: Alignment was bad

  9. #9
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Creating List of Data from Multiple Worksheets

    Quote Originally Posted by narrowgate88 View Post
    Result would look like this:

    Row 1 = A=Duplex B=Unit 195 C=Resident 1
    Row 2 = A=blank B= Unit 198 C=Resident 2
    Row 3 = A=Duplex B=Unit 104 C=Resident3
    Check the following code. I am assuming here that whenever you enter the data to output sheet, you want to clean the sheet first.

    Let me know if the code doesn't work for you.

    Please Login or Register  to view this content.
    HTH,
    Vikas
    Last edited by vikas.bhandari; 05-15-2009 at 01:38 AM. Reason: Adding code block

  10. #10
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Creating List of Data from Multiple Worksheets

    Yes, this worked perfectly. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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