vba courses london - select cell change

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

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

resolvedResolved · Low Priority · Version 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:

Empty The Clipboard with CutCopyMode

After each Copy/Paste operation in VBA, you should use the following line of code to empty the clipboard. This ensures that the computer memory doesn't overload:

ActiveSheet.Paste
Application.CutCopyMode = False

View all VBA hints and tips


Server loaded in 0.07 secs.