Scroll a cell to the top left hand corner of the screen

G

Guest

I want to be able to scroll a cell range to the top left hand corner of the
screen under macro control; just as Ctrl + Home does for cell A1.

Any ideas ??
 
D

Dave Peterson

How about this?

Option Explicit
Sub testme()
Dim myRng As Range
Set myRng = Worksheets("sheet2").Range("C3:d99")
Application.Goto myRng, scroll:=True
'or
'Application.Goto myRng.Cells(1), scroll:=True
End Sub
 
G

Guest

Thanks, just what I wanted !

Dave Peterson said:
How about this?

Option Explicit
Sub testme()
Dim myRng As Range
Set myRng = Worksheets("sheet2").Range("C3:d99")
Application.Goto myRng, scroll:=True
'or
'Application.Goto myRng.Cells(1), scroll:=True
End Sub
 

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