Results 1 to 6 of 6

selecting sheets defined in an array

Threaded View

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Red face selecting sheets defined in an array

    Right now I have a loop that selects sheets in the workbook like this:
            
    For i = 2 To 100
    Worksheets(i).Select (False)
    ActiveSheet.Range("H101").Select
    Next i
    Instead of selecting all sheets 2-100, I need only to select specific ones. So in the first sheet in cells P1:P100, I have which worksheet numbers (can be names vs. numbers as well) need to be selected. Some cells will have a number and some will not. So for example, cell P1 has 1, P2 is empty, P3 empty, P4 has 4, P5 has 5 and so on. How can I select only those sheets that are identified in column P? I'm guessing I need to refer to range P1:P100 as a vector and delete blanks from it, then select only those sheet numbers(or names) that are in the vector. Just not sure how to do that.

    Thank you
    Last edited by luv2glyd; 11-27-2015 at 09:33 PM.
    You either quit or become really good at it. There are no other choices.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 08-19-2015, 07:10 PM
  2. Copy, paste, replace- user defined range in all the defined sheets
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 12:28 PM
  3. Sheets(i).Select gives App-defined or Obj-defined error
    By torrmundi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-04-2013, 04:11 PM
  4. [SOLVED] Subscript error from Selecting array of sheets
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2012, 03:13 AM
  5. Integer defined array vs variant defined array ..error making assignment to integer
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2011, 01:48 PM
  6. Selecting sheets with an array of names
    By Mestlol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2010, 08:48 AM
  7. Selecting an array with a varying number of sheets
    By cbjorgol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2008, 09:41 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