Solved

Controlling Panes in MS XL

Posted on 2014-03-11
2
169 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 49

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

This collection of functions covers all the normal rounding methods of just about any numeric value.
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

770 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