+ Reply to Thread
Results 1 to 6 of 6

Loop through 2 sheets

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    London,England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Loop through 2 sheets

    Please Login or Register  to view this content.
    Without the loop for the sheets, it works out fine, and in sheet 3 is shown the results of the CountIf.
    With the loop, all the results are 0.
    Any idea what the problem is?

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Loop through 2 sheets

    You're giving us the minimum information possible. What are you trying to do? What are the variables? Is this line a typo?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-12-2009
    Location
    London,England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Loop through 2 sheets

    Please Login or Register  to view this content.
    typo indeed.
    Well, not a lot more of information is required.
    for example, I'm counting all the people named JEF in sheet 1 and 2.
    In sheet 3 you can see the results.
    So, I tried this For Next, to loop through the two sheets, but the results are 0.
    Please Login or Register  to view this content.
    But, if I do it without the loop for worksheets. It works perfectly, the negative point is that my code is twice as long.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Loop through 2 sheets

    Try referencing the sheet directly
    Please Login or Register  to view this content.
    and remove the Select line. I still can't follow your code - you should define your variables.

    Also, since you're asking a question here don't you think we should be the judge of how much information is needed?

  5. #5
    Registered User
    Join Date
    10-12-2009
    Location
    London,England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Loop through 2 sheets

    Please Login or Register  to view this content.
    This works, the right results are showed
    Please Login or Register  to view this content.
    This doesn't work, all the results are 0

    I hope this is enough information

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Loop through 2 sheets

    Repeatedly posting the same code is not information. Post a workbook. I don't see why you can't use formulae anyway.

+ 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