ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to navigate cursor (https://www.excelbanter.com/excel-programming/367898-macro-navigate-cursor.html)

Kevryl

Macro to navigate cursor
 
I frequently use macros to move cursor to a specific column, but haven't
worked out how to reliably set the screen so the destination column with the
cursor appears on the left hand side of the screen. Sometimes specifying a
row way off-screen to the right and coming back to the column works, but its
clumsy and unreliable. Any ideas?
Thanks
Keith

Harald Staff

Macro to navigate cursor
 
Hi Keith

This code puts D15 in the upper left side of the scrollable area and selects
E16:

Sub GoThere()
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollColumn = 4
Range("E16").Select
End Sub

Scrollable area is the spreadsheet itself unless you freeze rows/columns.

HTH. Best wishes Harald

"Kevryl" skrev i melding
...
I frequently use macros to move cursor to a specific column, but haven't
worked out how to reliably set the screen so the destination column with

the
cursor appears on the left hand side of the screen. Sometimes specifying a
row way off-screen to the right and coming back to the column works, but

its
clumsy and unreliable. Any ideas?
Thanks
Keith




Jean-Yves[_2_]

Macro to navigate cursor
 
Hello,

Open VBA help and search for "Goto Method"
Regards
Jean-Yves

"Kevryl" wrote in message
...
I frequently use macros to move cursor to a specific column, but haven't
worked out how to reliably set the screen so the destination column with
the
cursor appears on the left hand side of the screen. Sometimes specifying a
row way off-screen to the right and coming back to the column works, but
its
clumsy and unreliable. Any ideas?
Thanks
Keith




Kevryl

Macro to navigate cursor
 
Thanks Harald! Great stuff.
Keith

"Harald Staff" wrote:

Hi Keith

This code puts D15 in the upper left side of the scrollable area and selects
E16:

Sub GoThere()
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollColumn = 4
Range("E16").Select
End Sub

Scrollable area is the spreadsheet itself unless you freeze rows/columns.

HTH. Best wishes Harald

"Kevryl" skrev i melding
...
I frequently use macros to move cursor to a specific column, but haven't
worked out how to reliably set the screen so the destination column with

the
cursor appears on the left hand side of the screen. Sometimes specifying a
row way off-screen to the right and coming back to the column works, but

its
clumsy and unreliable. Any ideas?
Thanks
Keith





Kevryl

Macro to navigate cursor
 
Thanks Jean, you and Harald have both been very helpful.
Keith

"Jean-Yves" wrote:

Hello,

Open VBA help and search for "Goto Method"
Regards
Jean-Yves

"Kevryl" wrote in message
...
I frequently use macros to move cursor to a specific column, but haven't
worked out how to reliably set the screen so the destination column with
the
cursor appears on the left hand side of the screen. Sometimes specifying a
row way off-screen to the right and coming back to the column works, but
its
clumsy and unreliable. Any ideas?
Thanks
Keith






All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com