Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RJG RJG is offline
external usenet poster
 
Posts: 19
Default Move to a cell

If somebody types "yes" or "y" in cell C2 then I want the active cell
to be D2. If they put anything else in cell C2 i want the active cell
to move to C3 and then so down the page finishing at C101.(So if C3 is
"yes" then move to D3 etc)

What is the best way to achieve this please

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Move to a cell

Hi Bob,
Does this Worksheetevent help?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not (Intersect(Target, Range("c2").EntireColumn) Is Nothing) Then
If LCase(Target.Value) = "yes" Or LCase(Target.Value) = "y" Then
Target.Offset(0, 1).Activate
End If
End If

End Sub

Mike, from Luxembourg
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Move to a cell

Slight modification to deal with row range and possible copy/paste/delete of
a range of cells including some in column C:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim MoveOver As Boolean

If Target.Cells.Count = 1 Then
With Target
MoveOver = (.Column = 3) And (.Row 1) And (.Row < 102)
MoveOver = MoveOver And (LCase(.Value) = "y" Or LCase(.Value) = "yes")
If MoveOver Then .Offset(0, 1).Activate Else .Offset(1, 0).Activate
End With
End If

End Sub


--
- K Dales


"Mike" wrote:

Hi Bob,
Does this Worksheetevent help?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not (Intersect(Target, Range("c2").EntireColumn) Is Nothing) Then
If LCase(Target.Value) = "yes" Or LCase(Target.Value) = "y" Then
Target.Offset(0, 1).Activate
End If
End If

End Sub

Mike, from Luxembourg

  #4   Report Post  
Posted to microsoft.public.excel.programming
RJG RJG is offline
external usenet poster
 
Posts: 19
Default Move to a cell

Mike,
Perfect, a big thank you

Bob

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Move to a cell

There is a conflict if a Row is subsequently deleted.
get R/T error '13'
type mismatch;
Can this be avoided? - How?

"Mike" wrote in message
...
Hi Bob,
Does this Worksheetevent help?

Private Sub Worksheet_Change(ByVal Target As Range)

If Not (Intersect(Target, Range("c2").EntireColumn) Is Nothing) Then
If LCase(Target.Value) = "yes" Or LCase(Target.Value) = "y" Then
Target.Offset(0, 1).Activate
End If
End If

End Sub

Mike, from Luxembourg





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Move to a cell

Jim May wrote:
There is a conflict if a Row is subsequently deleted.
get R/T error '13'
type mismatch;
Can this be avoided? - How?

Hello Jim,
you can check whether more cells are selected

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then
If Not (Intersect(Target, Range("c2").EntireColumn) Is Nothing) Then
If LCase(Target.Value) = "yes" Or LCase(Target.Value) = "y" Then
Target.Offset(0, 1).Activate
End If
End If
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
How move arrow keys from cell to cell and NOT entire col/rows Arrow keys: cell to cell not entire row New Users to Excel 1 November 13th 09 05:19 PM
How do I move from cell A 10 to cell B1 with one move or click chipsdad Excel Worksheet Functions 3 June 6th 09 03:43 AM
formula, move to previous cell when the current cell=0 or empty osama amer Excel Discussion (Misc queries) 0 May 29th 06 12:18 PM
arrow keys move entire sheet instead of cell to cell gbeard Excel Worksheet Functions 2 April 13th 05 04:59 PM
Arrow keys move screen instead of moving from cell to cell. JaJay777 Setting up and Configuration of Excel 1 January 17th 05 06:48 PM


All times are GMT +1. The time now is 11:30 PM.

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"