{"id":4516,"date":"2015-12-26T17:50:17","date_gmt":"2015-12-26T17:50:17","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/wp\/?p=4516"},"modified":"2022-08-12T11:40:58","modified_gmt":"2022-08-12T11:40:58","slug":"visible-range-in-excel-active-window","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2015\/12\/visible-range-in-excel-active-window\/","title":{"rendered":"How to find Visible Range in Excel window on a Screen"},"content":{"rendered":"
Dear Friends,<\/p>\n
Its been a while I posted any post here. I am back with so many interesting stuff for you in Excel VBA. Here is a very small but useful excel vba tip for you.<\/p>\n
This is about knowing the range which are currently visible to the user on his\/her screen. Do not get confused with the visible or hidden cell here. This is not about that. This is more about how many rows and columns are visible of your excel window on different size of screens.<\/p>\n
It is a very simple command in VBA which gives you the visible range on your screen.<\/p>\n
\n\nActiveWindow.visibleRange\n<\/code><\/pre>\nAbove statement returns an Object of Range Type. <\/p>\n
From the above statement it is clear that VisibleRange<\/strong> is a method of ActiveWindow of an Excel. It is not related to a particular workbook but it works on ActiveWindow.<\/p>\nWhat is the use of this Method? <\/h3>\n
This is not a very common method to be used. But this is useful if you are trying to display some data in different format based on the visible range of your excel sheet for a different users having different size of monitors.<\/p>\n
To Make a particular Cell or Range in Center of the Screen<\/h2>\n
To do so, I will have to identify the center of the screen because every screen might have different size.<\/p>\n
Here the tricky part is identifying the Center of the screen Making a particular cell or cell range because center of the screen may vary for different size of screens. In this case, this method will help you making a cell range in the center of the screen.<\/p>\n
To Scroll to a particular cell in Excel, we will use Application.GoTo method.<\/p>\n
What is Application.GoTo Method and how it is used here? <\/h2>\n
Application.GoTo<\/strong> Method in Excel VBA takes input as a Range where you want to scroll and make that cell visible on the screen. This method always scroll the screen to make the cell at Top-Left corner cell on the screen. Here in this article I am not covering much about Application.GoTo<\/strong> method. Refer the below image:
\n