Solved

Controlling Panes in MS XL

Posted on 2014-03-11
2
171 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 50

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

828 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