Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Moving to cell based on condition of another cell

I'm creating a form and want to set it up so that if a data is entered into a
cell, then the cursor goes directly to a cell elsewhere within the
spreadsheet where additional info needs to be entered. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Moving to cell based on condition of another cell

You could use a macro like this: if data is entered into A1 then C3 is
selected.

To use/test this code, right click on worksheet tab, "view Code" and
copy/paste into code area.


Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit
Application.EnableEvents = False
If Target.Address = "$A$1" Then
Cells(3, "C").Select
End If
ws_exit:
Application.EnableEvents = True
End Sub

"tjmny" wrote:

I'm creating a form and want to set it up so that if a data is entered into a
cell, then the cursor goes directly to a cell elsewhere within the
spreadsheet where additional info needs to be entered. Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Moving to cell based on condition of another cell

Sheet event code? You did say "if data is entered".

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$C$2"
Range("C5").Select
Case "$C$5"
Range("E2").Select
Case "$E$2"
Range("E5").Select
End Select
End Sub

This is event code which runs when a value is entered in one of the trigger
cells.

Right-click on the sheet tab and "View Code". copy/paste the code into that
module.

For non-VBA methods of moving from one cell to another in sequence see Bob
Phillips's site.

http://www.xldynamic.com/source/xld.xlFAQ0008.html


Gord Dibben MS Excel MVP

On Thu, 15 Mar 2007 08:13:51 -0700, tjmny
wrote:

I'm creating a form and want to set it up so that if a data is entered into a
cell, then the cursor goes directly to a cell elsewhere within the
spreadsheet where additional info needs to be entered. Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Moving to cell based on condition of another cell

Gord,

Thanks - it works great.

"Gord Dibben" wrote:

Sheet event code? You did say "if data is entered".

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$C$2"
Range("C5").Select
Case "$C$5"
Range("E2").Select
Case "$E$2"
Range("E5").Select
End Select
End Sub

This is event code which runs when a value is entered in one of the trigger
cells.

Right-click on the sheet tab and "View Code". copy/paste the code into that
module.

For non-VBA methods of moving from one cell to another in sequence see Bob
Phillips's site.

http://www.xldynamic.com/source/xld.xlFAQ0008.html


Gord Dibben MS Excel MVP

On Thu, 15 Mar 2007 08:13:51 -0700, tjmny
wrote:

I'm creating a form and want to set it up so that if a data is entered into a
cell, then the cursor goes directly to a cell elsewhere within the
spreadsheet where additional info needs to be entered. Any ideas?



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
Hide cell values based on a condition in another cell Cat Excel Worksheet Functions 1 January 4th 07 07:21 AM
Is there a way to delete a cell value based on a condition? Peanut Excel Discussion (Misc queries) 2 October 2nd 06 09:55 PM
Fill a cell based on a condition being met confused teacher Excel Worksheet Functions 3 July 5th 06 08:29 AM
I want to fill the cell color based upon the other cell condition sri Excel Discussion (Misc queries) 4 January 12th 06 01:47 PM
Cell text based on 4 condition test Bob Wall Excel Worksheet Functions 3 November 16th 05 07:34 PM


All times are GMT +1. The time now is 12:40 PM.

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

About Us

"It's about Microsoft Excel"