Results 1 to 8 of 8

Select Case Problem

Threaded View

outofahat Select Case Problem 09-12-2016, 12:20 PM
buran Re: Select Case Problem 09-12-2016, 12:53 PM
outofahat Re: Select Case Problem 09-12-2016, 01:49 PM
AlphaFrog Re: Select Case Problem 09-12-2016, 12:58 PM
outofahat Re: Select Case Problem 09-12-2016, 01:53 PM
AlphaFrog Re: Select Case Problem 09-12-2016, 02:03 PM
outofahat Re: Select Case Problem 09-12-2016, 02:14 PM
StuCram Re: Select Case Problem 09-12-2016, 01:15 PM
  1. #1
    Registered User
    Join Date
    12-22-2011
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Select Case Problem

    Hey everyone, hopefully someone can save the rest of my hair here.

    I am trying to loop through 6 specific sheets and adjust their zoom level for displaying on a conference room TV. The code below works for the first 3 sheets wonderfully, but then errors out. If you step through it one line at a time, you can watch as it simply skips the last 3 sheets, as if they've already been done. The sheet names are definitely spelled correctly (copied directly from the tabs to be sure). I can't imagine what the heck I'm doing wrong. For now I'm just selecting each sheet individually and adjusting, but I am always trying to make my code more efficient wherever I can.

    Thanks in advance!

    Private Sub CommandButton3_Click()
    Dim ws As Worksheet, lngZoom As Long
     
    For Each ws In ThisWorkbook.Worksheets
         
        Select Case ws.Name
             
        Case "SIP Review": lngZoom = 250
        Case "MOR Dashboard": lngZoom = 200
        Case "Support Tickets": lngZoom = 210
        Case "Overall Score": lngZoom = 260
        Case "Outliers v1": lngZoom = 280
        Case "Outliers v2": lngZoom = 290
             
        End Select
        Application.ScreenUpdating = False
        With ws
            .Select
            ActiveWindow.Zoom = lngZoom
        End With
    Next ws
     
    Application.ScreenUpdating = True
    End Sub
    Last edited by outofahat; 09-12-2016 at 02:14 PM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Select Case problem
    By saziz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2015, 03:50 PM
  2. [SOLVED] Select Case problem
    By Darthzo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 11:49 AM
  3. select case problem
    By jippii in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-11-2011, 06:05 PM
  4. select case problem
    By waltron in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2010, 05:47 AM
  5. Long Select Case Problem
    By dsrt16 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2009, 09:58 PM
  6. [SOLVED] Having Problem with Select Case
    By haroldj@shfoodbank.org in forum Excel General
    Replies: 2
    Last Post: 07-26-2006, 06:15 PM
  7. Select case and Last Cell Problem
    By JamesBurrows in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2006, 12:55 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