+ Reply to Thread
Results 1 to 7 of 7

Using Array to Loop through specific sheets - need to add sheet name

  1. #1
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Using Array to Loop through specific sheets - need to add sheet name

    I am using an array to loop through specific sheets.
    Please Login or Register  to view this content.
    I want to add the name of the sheet to range("I2") - I tried .range("I2").value=Worksheets.name

    wks.name does not work
    If this solves your issue, Mark thread as Solved & Add Reputation.

    Thanks!

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Using Array to Loop through specific sheets - need to add sheet name

    How about
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: Using Array to Loop through specific sheets - need to add sheet name

    It gets Object required error

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Using Array to Loop through specific sheets - need to add sheet name

    Do all the sheets exist in your workbook?

  5. #5
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Using Array to Loop through specific sheets - need to add sheet name

    The following works for me in a new workbook with 4 worksheets.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Using Array to Loop through specific sheets - need to add sheet name

    Good point.

    Is there really any good reason for Option Explicit not to be the VBA default?

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Using Array to Loop through specific sheets - need to add sheet name

    Is there really any good reason for Option Explicit not to be the VBA default?
    None that I can think of.

+ 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 through array of sheets every 30seconds until WB closed
    By terratushi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2019, 09:34 AM
  2. [SOLVED] Store sheets into array via loop to copy to new book
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 09-18-2017, 09:28 AM
  3. [SOLVED] How to loop through two specific sheets
    By billj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2017, 01:58 PM
  4. loop through specific sheets
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2015, 07:15 PM
  5. [SOLVED] Help with: Range Array SelectCase Loop delete: Array All Sheet.Names
    By dlow in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-08-2015, 07:11 PM
  6. Loop thru an array of sheets
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-01-2014, 01:29 PM
  7. Macro to loop through sheets and print them out using an array
    By Masact in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2009, 04:00 PM

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