?
Solved

Controlling Panes in MS XL

Posted on 2014-03-11
2
Medium Priority
?
175 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 52

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

764 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