+ Reply to Thread
Results 1 to 2 of 2

VBA Beginner loop question

  1. #1
    Registered User
    Join Date
    08-06-2019
    Location
    sacramento
    MS-Off Ver
    365
    Posts
    21

    Question VBA Beginner loop question

    Hi, I just started VBA like 2days ago and I was trying to make a loop that will check contents of first columns in multiple sheets and produce results AND put filter on results.

    for example, sheet2 and sheet3 (first columns only) will be checked and produce result in sheet1 first column and put filter on sheet1 first column
    and then sheet2 and sheet4 check and result will be in sheet1 second column and put filter on sheet1 second column
    then sheet2 and sheet5, result in sheet1 third column and filter also..and so on...

    I tried to make a loop but all i could think of was for loops like "For i=1 to 10". But this will just run 10times no matter how many sheets i have..

    please can you guys enlighten me how to use loops effectively, not caring about how many times it should run?

    this is the code i came up with and still needs code for loop

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: VBA Beginner loop question

    I think what your asking is how do you know how many loops to do. In this case you need to know the number of sheets, so
    for i = 1 to Worksheets.Count
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this 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] (Beginner help) For loop inside do loop that displays information from reference sheet.
    By lediable007 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-08-2016, 03:20 PM
  2. Beginner question on "For Next" loop.
    By MarioK07 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-05-2013, 03:53 PM
  3. [SOLVED] DO UNTIL.... beginner question
    By biddum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2012, 06:49 PM
  4. Beginner question
    By Tony Vella in forum Excel General
    Replies: 22
    Last Post: 08-11-2006, 02:20 PM
  5. Beginner question!
    By Pat in forum Excel General
    Replies: 3
    Last Post: 08-07-2006, 04:25 AM
  6. [SOLVED] Need help with beginner VB question
    By Tim Whitley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2006, 12:50 PM
  7. [SOLVED] beginner question
    By Roshintosh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2005, 10:15 PM

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