+ Reply to Thread
Results 1 to 2 of 2

Loop through a subset of worksheets will not work

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Fresno, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Loop through a subset of worksheets will not work

    Greetings,

    I'm trying to insert two rows in a subset of worksheets in a workbook by defining a range in a worksheet and loop through the worksheets in that range, but the code will only run on the active worksheet.
    Please Login or Register  to view this content.
    Any thoughts on how I could get this loop to work?

    Thank you very much,
    Last edited by Leith Ross; 02-09-2014 at 06:14 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Loop through a subset of worksheets will not work

    Hi,

    You need to qualify code like
    Please Login or Register  to view this content.
    with the sheet name.i.e.

    Please Login or Register  to view this content.
    Although it's not clear to me why you use Dim sheet_name as range. I was expecting to see "As String"
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. [SOLVED] loop on Worksheets does not work
    By runneer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2013, 04:41 AM
  2. [SOLVED] Subset of worksheets
    By jlt199 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2013, 03:45 PM
  3. [SOLVED] Loop max value/ match functions to work on multiple worksheets
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2013, 07:13 PM
  4. Loop thru subset of properties?
    By geoB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2011, 12:05 AM
  5. Loop through worksheets within work book
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-11-2011, 06:09 AM

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