+ Reply to Thread
Results 1 to 2 of 2

Help with activating sheets

  1. #1
    Registered User
    Join Date
    08-12-2014
    Location
    ca
    MS-Off Ver
    2010
    Posts
    1

    Help with activating sheets

    I'm brand new to VBA macros. I have a VBA script that activates two different sheets in the same xlsx workbook. Or, at least I think it should. But the code below does not switch active sheets. The debug return text is always either 'Sheet1' repeated or 'Sheet5' repeated. Can someone help me understand why? This is running in powerpoint, by the way.

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Help with activating sheets

    Hello naturaltvventy,

    The sheet names are repeating because they are in the body of the loop For r = 2 To q .

    This loop is going from row to to the last row used on the active worksheet of the workbook running the macro.

    Without seeing the full macro or having more details about what you are trying to do, this is as far as I can go.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. transfer data between sheets without activating
    By carbie04xc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-18-2009, 08:14 AM
  2. Activating Sheets in another file and writing to them
    By weaseljw17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2006, 09:04 PM
  3. Looping thru Sheets without activating
    By Myles in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-30-2005, 12:10 PM
  4. Activating sheets with same name in multiple workbooks
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2005, 01:05 PM
  5. Protect/Unprotect sheets (without activating them)
    By Te4t0n in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2005, 03:47 AM

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