+ Reply to Thread
Results 1 to 5 of 5

Not looping to next worksheet

  1. #1
    Registered User
    Join Date
    12-07-2018
    Location
    canada
    MS-Off Ver
    2018
    Posts
    30

    Not looping to next worksheet

    I wrote some code to loop through and delete duplicates based on certain cells in the rows. The problem is that once it does it in a worksheet it is not moving on to the next worksheet in the active workbook.

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Not looping to next worksheet

    You need to qualify the next ws

    Example:

    Please Login or Register  to view this content.
    Do all of these replacements and give it another try.
    HTH
    Regards, Jeff

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Not looping to next worksheet

    It is looping, but you haven't connected the Cells or Rows properties to the ws variable so they apply to the active sheet. Use:

    Please Login or Register  to view this content.
    Rory

  4. #4
    Registered User
    Join Date
    12-07-2018
    Location
    canada
    MS-Off Ver
    2018
    Posts
    30

    Re: Not looping to next worksheet

    thank you both, was just staring at my screen too long

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Not looping to next worksheet

    You are very welcome. We are happy to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Help looping through all worksheet please!
    By ahazeldene in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-28-2017, 07:47 AM
  2. need help with looping through worksheet
    By gurtejhira in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-24-2015, 04:38 PM
  3. [SOLVED] Different ways of looping through a worksheet
    By AB33 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-05-2012, 08:48 AM
  4. Looping Checkboxes on Worksheet
    By Robbyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2005, 05:05 PM
  5. [SOLVED] looping thru the worksheet
    By cadcamguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2005, 03:05 PM
  6. [SOLVED] Looping Through Worksheet
    By lark in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2005, 12:06 PM
  7. Only works on One Worksheet, When Looping thru All WS
    By Dean in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2005, 02:06 PM

Tags for this Thread

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