+ Reply to Thread
Results 1 to 2 of 2

Counter for my GetSheets vba

  1. #1
    Registered User
    Join Date
    10-22-2014
    Location
    Madison, Wisconsin
    MS-Off Ver
    2010
    Posts
    1

    Question Counter for my GetSheets vba

    I have been trying to get a counter to populate column "L" in the active sheet for each workbook that is brought in using my GetSheets code (shown below). I need it to count when the counter is >0. The purpose of this is to use the results as a variable to drive another code to add in blank rows and paste certain cells from the other worksheets that are brought in. There is something I am missing as I have done this in the past with a counter but for some reason cant get it to work. Thank you!

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Counter for my GetSheets vba

    Hello beezie,

    Welcome to the Forum!

    First, you need to have a global variable that holds the count of the worksheets. A global variable can be accessed by any VBA routine.

    Second, you need to increment this variable inside your macro.

    Here is the revised code. This has to be in a VBA Module to work correctly.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Row counter
    By UsmanBPD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2012, 08:19 AM
  2. Day counter is this possible
    By moley165 in forum Excel General
    Replies: 9
    Last Post: 04-11-2012, 12:54 PM
  3. Row Counter
    By Lionel B. Dyck in forum Excel General
    Replies: 2
    Last Post: 08-03-2006, 04:05 PM
  4. Counter
    By EMoe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2006, 09:15 PM
  5. [SOLVED] Counter
    By Polina in forum Excel General
    Replies: 2
    Last Post: 05-27-2005, 05:05 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