how to confine the range of movement of cursor

  • Thread starter Thread starter starwil
  • Start date Start date
S

starwil

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?
 
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)
 
thanks for reply,
how to activate the VBA,
if not use VBA, excel have function key to do that?
 
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]
 
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 said:
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]
 
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 said:
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 said:
Grüezi starwil

starwil schrieb am 24.05.2004
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]
 
but i don't want to use VBA
i just want to know whether this is function key in excel
Chip Pearson said:
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 said:
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 said:
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top