Solved

Controlling Panes in MS XL

Posted on 2014-03-11
2
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
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…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

736 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