VB to get to top of page

A

ArcticWolf

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
 
D

Don Guillett

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

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

ArcticWolf

Perfect, cheers Don.

Don Guillett said:
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
(e-mail address removed)


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top