+ Reply to Thread
Results 1 to 2 of 2

Using VB in Exce, can I loop through all worksheets?

  1. #1
    Confused VB Person
    Guest

    Using VB in Exce, can I loop through all worksheets?

    I am trying to find a VB function that will allow me to run a macro through
    all worksheets in an Excel file? I am using an Excel file with 500
    worksheets. What is the VB command that will cycle through all worksheets in
    this Excel file?

    Thanks!!

  2. #2
    Jon Peltier
    Guest

    Re: Using VB in Exce, can I loop through all worksheets?

    Dim WS As Worksheet
    For Each WS In ActiveWorkbook.Worksheets
    ' do your stuff
    Next

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    Confused VB Person wrote:

    > I am trying to find a VB function that will allow me to run a macro through
    > all worksheets in an Excel file? I am using an Excel file with 500
    > worksheets. What is the VB command that will cycle through all worksheets in
    > this Excel file?
    >
    > Thanks!!


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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