Solved

Controlling Panes in MS XL

Posted on 2014-03-11
2
165 Views
Last Modified: 2014-03-12
I have two buttons on an excel worksheet.  They both perform the same macro; the only difference is where the cursor ends up at the end of the macro.  If button A is pressed, cell(5,3) is selected at the end of the macro;  if button B is pressed, cell(56,3) is selected.  The two buttons can be viewed simultaneously in separate panes.  When they are so viewed, I would like the final selected cell to be displayed in the same pane that held the button that was pressed – for example, if button B is pressed in the lower pane, I would like the final selected cell for button B (i.e. cell(56,3)) to be shown in the lower pane; with the upper pane unchanged.  What seems to happen is that if I press the button in the upper pane, the final selected cell is displayed in the upper pane, and the lower pane scrolls to that final selected cell as well.  If I press the button in the lower pane, the final selected cell is displayed in the lower pane and the upper pane remains as it was.  This is true no matter which button is displayed in which pane.  Can someone show me how to control this situation in VBA so that only the pane containing the pressed button is scrolled?  thanks.
0
Comment
Question by:Langdans
2 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39922746
Hi,

the problem is maybe that you code scrolls the the window ( it's most of the time not necessary)

Could you send your code?
EDIT
If you want to control where you code works, use (the other panes unless in your case you move to much horizontally)

ActiveWindow.Panes(2).Activate

Open in new window

the Panes are

1 - 2
3 - 4

So if you only have a vertical separation use 1 and 2 and if you only have a horizontal separation use 1 and 3 to select your pane

Regards
0
 

Author Closing Comment

by:Langdans
ID: 39924292
I turned off screenUpdating while the code ran, based on the suggestion that the code might be scrolling the window.  Panes act as intended now.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now