Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba courses london - select cell change

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

ResolvedVersion Standard

Mandy has attended:
Access Intermediate course
Access Advanced course

Select cell - change view

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

Edited on Tue 20 Mar 2007, 11:09

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

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

VBA tip:

Stop Display Alerts In Excel

When creating or deleting a Worksheet in Excel you don't want Excel to inform you "A file already exists....." Or "Do you want to save this file...".

To stop these alerts happening use the following line of code:

Application.DisplayAlerts = False

After the Create or Delete routine use:

Application.DisplayAlerts = True

View all VBA hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.