ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to confine the range of movement of cursor (https://www.excelbanter.com/excel-programming/299243-how-confine-range-movement-cursor.html)

starwil[_2_]

how to confine the range of movement of cursor
 
for example, if i just want to let the cursor in worksheet move from column
A to V and / or row 1 to 50,
how to setup?



Bob Phillips[_6_]

how to confine the range of movement of cursor
 
Here is some VBA top do it

Dim oldCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row 50 Or Target.Column 22 Then
If Not oldCell Is Nothing Then
oldCell.Activate
Else
Me.Range("A1").Activate
End If
Else
Set oldCell = Target
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"starwil" wrote in message
...
for example, if i just want to let the cursor in worksheet move from

column
A to V and / or row 1 to 50,
how to setup?





starwil[_2_]

how to confine the range of movement of cursor
 
thanks for reply,
how to activate the VBA,
if not use VBA, excel have function key to do that?
"starwil" ¦b¶l¥ó ¤¤¼¶
¼g...
for example, if i just want to let the cursor in worksheet move from

column
A to V and / or row 1 to 50,
how to setup?





Thomas Ramel

how to confine the range of movement of cursor
 
Grüezi starwil

starwil schrieb am 24.05.2004

for example, if i just want to let the cursor in worksheet move from column
A to V and / or row 1 to 50,
how to setup?


Just hide the non-used cells/rows.

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]

starwil

how to confine the range of movement of cursor
 
i know this function, i just want to lock the scrolling and movement of
cursor after certain column, and keep the cell unhide, so hide some cells is
not suitable.....

"Thomas Ramel"
t...
Grüezi starwil

starwil schrieb am 24.05.2004

for example, if i just want to let the cursor in worksheet move from

column
A to V and / or row 1 to 50,
how to setup?


Just hide the non-used cells/rows.

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]




Chip Pearson

how to confine the range of movement of cursor
 
You can use the ScrollArea property of the Worksheet to restrict
the user to a range of cells. E.g.,

ActiveSheet.ScrollArea = "$A$1:$G$10"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"starwil" wrote in message
...
i know this function, i just want to lock the scrolling and

movement of
cursor after certain column, and keep the cell unhide, so hide

some cells is
not suitable.....

"Thomas Ramel"
t...
Grüezi starwil

starwil schrieb am 24.05.2004

for example, if i just want to let the cursor in worksheet

move from
column
A to V and / or row 1 to 50,
how to setup?


Just hide the non-used cells/rows.

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]






starwil

how to confine the range of movement of cursor
 
but i don't want to use VBA
i just want to know whether this is function key in excel
"Chip Pearson" ¼¶¼g©ó¶l¥ó·s»D
...
You can use the ScrollArea property of the Worksheet to restrict
the user to a range of cells. E.g.,

ActiveSheet.ScrollArea = "$A$1:$G$10"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"starwil" wrote in message
...
i know this function, i just want to lock the scrolling and

movement of
cursor after certain column, and keep the cell unhide, so hide

some cells is
not suitable.....

"Thomas Ramel"
t...
Grüezi starwil

starwil schrieb am 24.05.2004

for example, if i just want to let the cursor in worksheet

move from
column
A to V and / or row 1 to 50,
how to setup?

Just hide the non-used cells/rows.

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]









All times are GMT +1. The time now is 05:13 PM.

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