View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Advance to predetermined cell

Did you copy it to the sheet module as JL instructed?

If so, it will still do nothing until you go to B1 and enter something to create
a "change" that will fire the code to take you to D31.

BTW......you missed the .Select at

Case Is = "$B$43"
Range ("C43")


Gord Dibben MS Excel MVP

On Tue, 9 Jan 2007 16:25:00 -0800, Publius
wrote:

Thanks. But would you mind taking a look at the code and see if you can
decipher what I'm doing wrong. It does not work at all. THANKS!

Private Sub Worksheet_Change(ByVal Target As Range)

Select Case Target.Address
Case Is = "$B$1"
Range("D31").Select
Case Is = "$D$31"
Range("D33").Select
Case Is = "$D$33"
Range("B38").Select
Case Is = ("$B$38")
Range("C38").Select
Case Is = ("$C$38")
Range("B39").Select
Case Is = ("$C$39")
Range("B40").Select
Case Is = ("$B$40")
Range("C40").Select
Case Is = ("$B$41")
Range("B41").Select
Case Is = "$B$43"
Range ("C43")
Case Else
'ignor anything else
End Select

End Sub

"JLatham" wrote:

Not a worksheet function to do that. But the worksheet_Change() event was
just made for it! Here's a quick piece of code you can adapt easily, Make
sure you use the $ symbols in the addresses tested. There are other ways to
use this event routine to do this kind of thing, but as long as you're
dealing with just a few cells on a sheet this should work ok without being
too time consuming:

Private Sub Worksheet_Change(ByVal Target As Range)

Select Case Target.Address
Case Is = "$C$12"
Range("B14").Select
Case Is = "$D$12", "$E$12"
Range("G11").Select
Case Else
'ignor anything else
End Select

End Sub

To put the code in the right place, right-click on the sheet's tab and
choose [View Code] then cut and paste this into the code sheet presented to
you.

"Publius" wrote:

In Excel 2002 I want to insert a command in certain (not all) cells that once
data is entered therein and "enter" or a hot key is pressed advances the cell
selection to another specific (specified) cell within the worksheet. For
example: type "123" in C-1 and pressing "enter" moves the next cell
selection to E-12. Can anyone tell me how to do this?