Results 1 to 9 of 9

Looping Through Worksheets and Activating

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-26-2009
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    286

    Looping Through Worksheets and Activating

    I have worksheets Process, Process1, Process2 etc and I'm using the code below to loop through the sheets. It works but does not activate each worksheet so that I can do something on that worksheet.

    Dim ws As Worksheet
        For Each ws In Sheets
            With ws
                If InStr(1, .Name, "Process", 1) > 0 Then
                    MsgBox "Activating Current Worksheet"
                End If
            End With
        Next
    How can I modify it to work. Thanks Sandy
    Last edited by gsandy; 03-05-2017 at 08:26 PM. Reason: Instant email replys

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. why isn't this looping through all worksheets? :(
    By KATIEexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2014, 09:12 AM
  2. [SOLVED] Looping through worksheets
    By The Phil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2014, 10:21 AM
  3. Replies: 1
    Last Post: 04-18-2013, 12:18 PM
  4. Activating/De-Activating Comments or only if the Cell is Active.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-31-2011, 11:08 AM
  5. Looping thru Sheets without activating
    By Myles in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-30-2005, 12:10 PM
  6. Looping through Worksheets
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-12-2005, 03:05 PM
  7. Looping across worksheets
    By Ramthebuffs in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2005, 12:52 AM

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