+ Reply to Thread
Results 1 to 9 of 9

Deactivate Split Window

  1. #1
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Deactivate Split Window

    Hi All,

    I have a workbook with multiple worksheets, with one worksheet that has two macros assigned to buttons on that one sheet. The macros are designed to vertically split the window, then to reset the view to normal.
    The macro attached to the first button is:
    Please Login or Register  to view this content.
    The macro attached to the second button is:
    Please Login or Register  to view this content.
    Both macros work fine as long as that one sheet is active. The problem is, when I switch to a different sheet in that workbook, or a different sheet in a different workbook, without resetting the view first, the split view remains and I get multiple vertical windows.
    When I tried this code in the worksheet object:
    Please Login or Register  to view this content.
    The view will reset but I keep getting a prompt to save changes to the workbook when I switch to a different sheet.
    Any guidance as to what I am doing wrong would be greatly appreciated, thanks!

  2. #2
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: Deactivate Split Window

    Bumping along.

  3. #3
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: Deactivate Split Window Update

    I've done some updates to the buttons to improve the format and rule out some variables. Button 1:
    Please Login or Register  to view this content.
    Button 2:
    Please Login or Register  to view this content.
    I still havent found a good way to deactivate the view on the worksheet deactrivate event, and still have the problem that if an open workbook exists, the first macro will pull whatever the active sheet is in to the split view, making 3 or more windows instead of two however.
    Also, does anyone know of a good way to activate either window 1 or 2 without using the specific name of the workbook, but just referencing this workbook? I'm attempting to rule out any changes to the workbook name.

    Thanks!

  4. #4
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: Deactivate Split Window

    Bumping along.

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Deactivate Split Window

    What happens if you comment out the
    Please Login or Register  to view this content.
    line in your initial Deactivate code? This should restrict to active workbook only, though have only had a quick look at your problem.
    Please Login or Register  to view this content.
    Last edited by StephenR; 11-07-2014 at 01:32 PM.

  6. #6
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: Deactivate Split Window

    Hello Steven, thanks for the reply.
    Looks like I get a run time error when I do that, but after I uncommented again, it seems like the window is now deactivating when switching between different sheets in the same book, which solves the first problem. I must have been doing something wrong lol.
    Any ideas on how to fix the other open work book problem though?

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Deactivate Split Window

    Try the edit to my post above.

  8. #8
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: Deactivate Split Window

    Quote Originally Posted by StephenR View Post
    Try the edit to my post above.
    Thanks Steven, that appears to have done the trick! Marking this as solved, thanks!
    Final Code:
    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Deactivate Split Window

    Glad it worked.

+ 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. Replies: 2
    Last Post: 09-11-2013, 04:35 AM
  2. split window and scrolling
    By sweeney132 in forum Excel General
    Replies: 5
    Last Post: 07-24-2009, 02:06 PM
  3. split window
    By scindy in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-06-2006, 05:25 PM
  4. Split window
    By jspizman in forum Excel General
    Replies: 1
    Last Post: 01-24-2006, 01:45 PM
  5. Split Window
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2005, 01: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