|
Forum home »
Delegate support and help forum »
Microsoft VBA Training and help » vba courses london - Select cell - change view
vba courses london - Select cell - change view
The UK's most regular instructor-led training courses.
Training information: vba courses london
· Excel london Resolved · Low Priority · Version Standard
Select cell - change view
by - delegate Mandy [3 posts] (2007 Mar 14 Wed, 14:07) Reply
Hi when I write the following small piece of VBA:
Sub Thresholds()
' Take the user to the Threshold update area
Range("O25").Select
End Sub
I want the cell selected (O25) to be in the TOP LEFT of the screen (it currently is in the middle so I can see Columns L onwards and rows 1 downwards
I only want to be able to see columns O onwards and 25 and downwards
Regards
Mandy
RE: Select cell - change view
Hi Mandy
To set your cell selection to the TOP LEFT you can do the following:
Always start on Range ("A1") for consistency. Then select select the target cell
Then use the SmallScroll method as seen below in the updated Thresholds Sub.
NB You scroll to the right one less number than the taget column and scroll down one less numberthan the target row.
Sub Thresholds()
' Take the user to the Threshold update area
Range("A1").Select 'Always start at "A1"
Range("O25").Select 'The target cell
ActiveWindow.SmallScroll ToRight:=14 'One lees than the number of Columns
ActiveWindow.SmallScroll Down:=24 'One less than the number of Rows
End Sub
|