+ Reply to Thread
Results 1 to 6 of 6

Do ELSE only once

  1. #1
    Registered User
    Join Date
    04-01-2017
    Location
    Calgary, AB
    MS-Off Ver
    windows 10
    Posts
    8

    Do ELSE only once

    Hi,

    I would like to do the Else (scroll) action only once

    If I click AC15, it will zoom in; If I click out, It will zoomout, but it will keep scrolling to the left anytime I click anywhere; I want the focus/scroll to be set once or until I click the cell again;

    This is what I have

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If Target.Address = "$AC$15" Then
    ActiveWindow.Zoom = 120
    ActiveWindow.ScrollColumn = 20
    Else
    ActiveWindow.Zoom = 70
    ActiveWindow.LargeScroll ToRight:=-1
    End If

    End Sub

    Thank You

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Do ELSE only once

    Hello
    Welcome to the forum
    Please put the code between code tags

    Try to remove this line
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    04-01-2017
    Location
    Calgary, AB
    MS-Off Ver
    windows 10
    Posts
    8

    Re: Do ELSE only once

    Hi,

    I do have it removed for now, but wanted to see somehow I can have it scroll to the left only once when I click out

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Do ELSE only once

    Please Login or Register  to view this content.
    Please take a few minutes to read the forum rules, and then edit your first post to add CODE tags.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    04-01-2017
    Location
    Calgary, AB
    MS-Off Ver
    windows 10
    Posts
    8

    Re: Do ELSE only once

    Amazing!! Thank You!!!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Do ELSE only once

    You're welcome.

    But once again, please add CODE tags to your first post.
    Last edited by shg; 04-14-2017 at 05:12 PM.

+ 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