+ Reply to Thread
Results 1 to 3 of 3

How do you loops through each tab

  1. #1
    Forum Contributor
    Join Date
    10-01-2013
    Location
    United States
    MS-Off Ver
    Microsoft version 365
    Posts
    110

    How do you loops through each tab

    I have a spreadsheet with the months jan-dec and I want to open the tab based on a certain month. If the month have data already in certain cells, I want to loop through this and go to the next tab.

  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: How do you loops through each tab

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.

    It's not clear how many cells you have to check in each tab, or whether there has to be a specific values in each cell or if ANY value will suffice.
    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.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How do you loops through each tab

    Hi sony,

    In VBA most things have "index" and "Count".
    In the immediate window you can type "debug.print Worksheets.Count" and press enter to find how many tabs you have.
    Note "Debug.Print" can be shortened to "?"
    You can use the Worksheet(index) to find the name of the worksheet like using, in the immediate window.
    "?Worksheets(2).name" and press enter. This shows "Sheet2" for me.

    To loop through each worksheet name something like:
    Please Login or Register  to view this content.
    Hope this helps.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Loops within Loops - Populating all cells with same data
    By madrewise8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2021, 09:15 AM
  2. Loops within loops looping
    By Memphismark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2017, 12:21 PM
  3. IF loops
    By E1N5T31N in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2015, 04:03 PM
  4. Loops
    By TheGainmaker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2011, 12:04 PM
  5. VBA Loops
    By mistadarcy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2011, 01:57 PM
  6. Help with Loops
    By Impartial Derivative in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2011, 01:48 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