Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Selecting a certain cell

Hi!
I donīt get it although it seemd to be so simple.
I want that after I entered a word in column A1 the cursor selects B1 and
after that A2 (and so on: B2-A3-B3...)

I tried it with this code but there seems to be a problem with the default
cursor movement. Who can help?

Many thanks
Bernd

Sub auto_open()
Application.OnEntry = "start"
End Sub

Sub start()
If ActiveCell.Column = 1 Then
Cells(ActiveCell.Row, ActiveCell.Column + 1).Select
Else
If ActiveCell.Column = 2 Then
Cells(ActiveCell.Row + 1, ActiveCell.Column - 1).Select
End If
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Selecting a certain cell

use the sheet's change event:
Right click the sheet tab & select "View Code"
Add This:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 1 Then
Target.Offset(1, 0).Select
ElseIf Target.Row = 2 Then
Target.Offset(-1, 1).Select
End If
End Sub

HTH
Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Hi!
I donīt get it although it seemd to be so simple.
I want that after I entered a word in column A1 the

cursor selects B1 and
after that A2 (and so on: B2-A3-B3...)

I tried it with this code but there seems to be a

problem with the default
cursor movement. Who can help?

Many thanks
Bernd

Sub auto_open()
Application.OnEntry = "start"
End Sub

Sub start()
If ActiveCell.Column = 1 Then
Cells(ActiveCell.Row, ActiveCell.Column +

1).Select
Else
If ActiveCell.Column = 2 Then
Cells(ActiveCell.Row + 1, ActiveCell.Column -

1).Select
End If
End Sub


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Selecting a certain cell

IF I understand what you want, if in col A you want to goto col B and if in
col B you want to goto A one cell down. If so
Right click on the sheet tabview codeinsert thissave
As written it won't work in the 1st 3 rows

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Row 3 And Target.Column = 1 Then ActiveCell.Offset(0, 1).Select
If Target.Row 3 And Target.Column = 2 Then ActiveCell.Offset(1, -1).Select
End Sub



--
Don Guillett
SalesAid Software

"Bernd" wrote in message
y.telekom.at...
Hi!
I donīt get it although it seemd to be so simple.
I want that after I entered a word in column A1 the cursor selects B1 and
after that A2 (and so on: B2-A3-B3...)

I tried it with this code but there seems to be a problem with the default
cursor movement. Who can help?

Many thanks
Bernd

Sub auto_open()
Application.OnEntry = "start"
End Sub

Sub start()
If ActiveCell.Column = 1 Then
Cells(ActiveCell.Row, ActiveCell.Column + 1).Select
Else
If ActiveCell.Column = 2 Then
Cells(ActiveCell.Row + 1, ActiveCell.Column - 1).Select
End If
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Selecting a certain cell

Great!

Many thanks
Bernd

"Don Guillett" schrieb im Newsbeitrag
...
IF I understand what you want, if in col A you want to goto col B and if

in
col B you want to goto A one cell down. If so
Right click on the sheet tabview codeinsert thissave
As written it won't work in the 1st 3 rows

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Row 3 And Target.Column = 1 Then ActiveCell.Offset(0,

1).Select
If Target.Row 3 And Target.Column = 2 Then

ActiveCell.Offset(1, -1).Select
End Sub



--
Don Guillett
SalesAid Software

"Bernd" wrote in message
y.telekom.at...
Hi!
I donīt get it although it seemd to be so simple.
I want that after I entered a word in column A1 the cursor selects B1

and
after that A2 (and so on: B2-A3-B3...)

I tried it with this code but there seems to be a problem with the

default
cursor movement. Who can help?

Many thanks
Bernd

Sub auto_open()
Application.OnEntry = "start"
End Sub

Sub start()
If ActiveCell.Column = 1 Then
Cells(ActiveCell.Row, ActiveCell.Column + 1).Select
Else
If ActiveCell.Column = 2 Then
Cells(ActiveCell.Row + 1, ActiveCell.Column - 1).Select
End If
End Sub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Selecting a certain cell

Bernd

As an alternative to Macro solution.......

Select Columns A and B then FormatCellsProtection uncheck "locked".

ToolsProtectionProtect Sheet.

Use the TAB key when entering data in A1 to go to B1, A2, B2 etc.

Gord Dibben XL2002

On Tue, 25 Nov 2003 14:53:59 +0100, "Bernd"
wrote:

Hi!
I donīt get it although it seemd to be so simple.
I want that after I entered a word in column A1 the cursor selects B1 and
after that A2 (and so on: B2-A3-B3...)

I tried it with this code but there seems to be a problem with the default
cursor movement. Who can help?

Many thanks
Bernd

Sub auto_open()
Application.OnEntry = "start"
End Sub

Sub start()
If ActiveCell.Column = 1 Then
Cells(ActiveCell.Row, ActiveCell.Column + 1).Select
Else
If ActiveCell.Column = 2 Then
Cells(ActiveCell.Row + 1, ActiveCell.Column - 1).Select
End If
End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 single cell selecting muliple cell Submit2s Excel Worksheet Functions 1 February 12th 09 04:52 PM
Selecting a cell entry based on cell validation selection Brutalius Excel Worksheet Functions 2 December 17th 08 03:44 AM
Transfer cell values to another cell by selecting button. Gryndar Excel Worksheet Functions 2 November 24th 08 02:21 AM
selecting the next cell down George Excel Discussion (Misc queries) 2 September 20th 06 07:45 PM
selecting next available cell girth69 Excel Discussion (Misc queries) 5 April 12th 06 05:01 PM


All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"