ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB to get to top of page (https://www.excelbanter.com/excel-programming/436670-vbulletin-get-top-page.html)

ArcticWolf

VB to get to top of page
 
Hi,

I have a sheet which contains 20+ pivot tables. I have a 2nd sheet with a
load of buttons on, which when clicked take the user to the correct part of
the pivot table sheet.

Sheets("Pivot Tables").Select
Range("A211").Select

The pivot table sheet is 500+ lines (some of the PT's are quite big!) and I
have 'split' the sheet so the first 2 rows are always shown.

When I click on the button it takes me to the correct location, but it puts
me in the 'middle of the screen' (I then have to scroll down, half a page to
see the full table) I would like it so that in the instance above the rows
will go 1, 2, 211, 212 (it currently goes 1, 2, 188, 189, 190..... so row 211
is in the middle of the screen.
I don't want to hide or remove any of the rows, just have them show at the
top of the screen insread of in the middle.

I hope that makes sense, and is possible?

TIA,

AW

Don Guillett

VB to get to top of page
 
How about a nice ONE liner. change sheet and range to suit

Sub gothere()
Application.Goto Sheets("forms").Range("a13"), scroll:=True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ArcticWolf" wrote in message
...
Hi,

I have a sheet which contains 20+ pivot tables. I have a 2nd sheet with a
load of buttons on, which when clicked take the user to the correct part
of
the pivot table sheet.

Sheets("Pivot Tables").Select
Range("A211").Select

The pivot table sheet is 500+ lines (some of the PT's are quite big!) and
I
have 'split' the sheet so the first 2 rows are always shown.

When I click on the button it takes me to the correct location, but it
puts
me in the 'middle of the screen' (I then have to scroll down, half a page
to
see the full table) I would like it so that in the instance above the
rows
will go 1, 2, 211, 212 (it currently goes 1, 2, 188, 189, 190..... so row
211
is in the middle of the screen.
I don't want to hide or remove any of the rows, just have them show at the
top of the screen insread of in the middle.

I hope that makes sense, and is possible?

TIA,

AW



ArcticWolf

VB to get to top of page
 
Perfect, cheers Don.

"Don Guillett" wrote:

How about a nice ONE liner. change sheet and range to suit

Sub gothere()
Application.Goto Sheets("forms").Range("a13"), scroll:=True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ArcticWolf" wrote in message
...
Hi,

I have a sheet which contains 20+ pivot tables. I have a 2nd sheet with a
load of buttons on, which when clicked take the user to the correct part
of
the pivot table sheet.

Sheets("Pivot Tables").Select
Range("A211").Select

The pivot table sheet is 500+ lines (some of the PT's are quite big!) and
I
have 'split' the sheet so the first 2 rows are always shown.

When I click on the button it takes me to the correct location, but it
puts
me in the 'middle of the screen' (I then have to scroll down, half a page
to
see the full table) I would like it so that in the instance above the
rows
will go 1, 2, 211, 212 (it currently goes 1, 2, 188, 189, 190..... so row
211
is in the middle of the screen.
I don't want to hide or remove any of the rows, just have them show at the
top of the screen insread of in the middle.

I hope that makes sense, and is possible?

TIA,

AW


.



All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com