PC Review


Reply
Thread Tools Rate Thread

Auto-jump to another cell

 
 
Ellen G
Guest
Posts: n/a
 
      30th Nov 2007
Hi there --

I have a color coded key at the top of my spreadsheet. One cell is blue, one
cell is red, etc. I would like the user to be able to click on one of those
cells and automatically jump to the appropriate section in the spreadsheet. I
saw another posting with the following code using validation:

Private Sub Worksheet_Change(ByVal Target As Range)
ActiveCell.Offset(1, 0).Select
End Sub

I was able to make this work by inserting something into the color-coded
cell. However, I have 5 color-coded cells and each needs to jump to a
different section of the spreadsheet.

So I have a couple of questions:

1. First, can I automatically jump simply by clicking on the cell, without
having to insert something?
2. How do I insert code for each individual jump?

If you are able to provide code and guidance it would be most helpful if you
could explain each piece in the code so that I understand what I'm doing.

Thanks so much.

Ellen


 
Reply With Quote
 
 
 
 
excelent
Guest
Posts: n/a
 
      30th Nov 2007
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex = 1 Then Target.Offset(2, 5).Select
If Target.Interior.ColorIndex = 2 Then Target.Offset(4, 5).Select
If Target.Interior.ColorIndex = 3 Then Target.Offset(6, 5).Select
End Sub

"Ellen G" skrev:

> Hi there --
>
> I have a color coded key at the top of my spreadsheet. One cell is blue, one
> cell is red, etc. I would like the user to be able to click on one of those
> cells and automatically jump to the appropriate section in the spreadsheet. I
> saw another posting with the following code using validation:
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> ActiveCell.Offset(1, 0).Select
> End Sub
>
> I was able to make this work by inserting something into the color-coded
> cell. However, I have 5 color-coded cells and each needs to jump to a
> different section of the spreadsheet.
>
> So I have a couple of questions:
>
> 1. First, can I automatically jump simply by clicking on the cell, without
> having to insert something?
> 2. How do I insert code for each individual jump?
>
> If you are able to provide code and guidance it would be most helpful if you
> could explain each piece in the code so that I understand what I'm doing.
>
> Thanks so much.
>
> Ellen
>
>

 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      30th Nov 2007
You can do it with a hyperlink formula - no need for code. Suppose
your blue section begins in A6 (i.e. the cell you want to jump to),
then put this formula in the blue key cell:

=HYPERLINK("#"&"A6","")

If your red section begins at cell A46, then use this formula in the
red key cell:

=HYPERLINK("#"&"A46","")

You can see how the formula varies - the cell reference is the cell
you want to jump to, so put similar formulae in the other coloured
cells of your key.

If you click on the red key cell, your cursor will jump to A46. Click
on another coloured key cell, and the cursor will jump to where that
cell points to.

Hope this helps.

Pete




On Nov 30, 4:29 pm, Ellen G <Ell...@discussions.microsoft.com> wrote:
> Hi there --
>
> I have a color coded key at the top of my spreadsheet. One cell is blue, one
> cell is red, etc. I would like the user to be able to click on one of those
> cells and automatically jump to the appropriate section in the spreadsheet. I
> saw another posting with the following code using validation:
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> ActiveCell.Offset(1, 0).Select
> End Sub
>
> I was able to make this work by inserting something into the color-coded
> cell. However, I have 5 color-coded cells and each needs to jump to a
> different section of the spreadsheet.
>
> So I have a couple of questions:
>
> 1. First, can I automatically jump simply by clicking on the cell, without
> having to insert something?
> 2. How do I insert code for each individual jump?
>
> If you are able to provide code and guidance it would be most helpful if you
> could explain each piece in the code so that I understand what I'm doing.
>
> Thanks so much.
>
> Ellen


 
Reply With Quote
 
Ellen G
Guest
Posts: n/a
 
      30th Nov 2007
I'm not sure this will work since I have other cells in the spreadsheet with
the same color. When those are accessed, I don't want the cursor to jump. So,
could you provide me with a formula requiring text to be typed in the cell
(i.e. "go1", "go2", etc.)? Thanks so much.

Ellen

"excelent" wrote:

> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> If Target.Interior.ColorIndex = 1 Then Target.Offset(2, 5).Select
> If Target.Interior.ColorIndex = 2 Then Target.Offset(4, 5).Select
> If Target.Interior.ColorIndex = 3 Then Target.Offset(6, 5).Select
> End Sub
>
> "Ellen G" skrev:
>
> > Hi there --
> >
> > I have a color coded key at the top of my spreadsheet. One cell is blue, one
> > cell is red, etc. I would like the user to be able to click on one of those
> > cells and automatically jump to the appropriate section in the spreadsheet. I
> > saw another posting with the following code using validation:
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > ActiveCell.Offset(1, 0).Select
> > End Sub
> >
> > I was able to make this work by inserting something into the color-coded
> > cell. However, I have 5 color-coded cells and each needs to jump to a
> > different section of the spreadsheet.
> >
> > So I have a couple of questions:
> >
> > 1. First, can I automatically jump simply by clicking on the cell, without
> > having to insert something?
> > 2. How do I insert code for each individual jump?
> >
> > If you are able to provide code and guidance it would be most helpful if you
> > could explain each piece in the code so that I understand what I'm doing.
> >
> > Thanks so much.
> >
> > Ellen
> >
> >

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      30th Nov 2007
Revised...........

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "A1:C1"
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
If Target.Interior.ColorIndex = 1 Then Target.Offset(2, 5).Select
If Target.Interior.ColorIndex = 2 Then Target.Offset(4, 5).Select
If Target.Interior.ColorIndex = 3 Then Target.Offset(6, 5).Select
End If
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Nov 2007 09:03:02 -0800, Ellen G <(E-Mail Removed)>
wrote:

>I'm not sure this will work since I have other cells in the spreadsheet with
>the same color. When those are accessed, I don't want the cursor to jump. So,
>could you provide me with a formula requiring text to be typed in the cell
>(i.e. "go1", "go2", etc.)? Thanks so much.
>
>Ellen
>
>"excelent" wrote:
>
>> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>> If Target.Interior.ColorIndex = 1 Then Target.Offset(2, 5).Select
>> If Target.Interior.ColorIndex = 2 Then Target.Offset(4, 5).Select
>> If Target.Interior.ColorIndex = 3 Then Target.Offset(6, 5).Select
>> End Sub
>>
>> "Ellen G" skrev:
>>
>> > Hi there --
>> >
>> > I have a color coded key at the top of my spreadsheet. One cell is blue, one
>> > cell is red, etc. I would like the user to be able to click on one of those
>> > cells and automatically jump to the appropriate section in the spreadsheet. I
>> > saw another posting with the following code using validation:
>> >
>> > Private Sub Worksheet_Change(ByVal Target As Range)
>> > ActiveCell.Offset(1, 0).Select
>> > End Sub
>> >
>> > I was able to make this work by inserting something into the color-coded
>> > cell. However, I have 5 color-coded cells and each needs to jump to a
>> > different section of the spreadsheet.
>> >
>> > So I have a couple of questions:
>> >
>> > 1. First, can I automatically jump simply by clicking on the cell, without
>> > having to insert something?
>> > 2. How do I insert code for each individual jump?
>> >
>> > If you are able to provide code and guidance it would be most helpful if you
>> > could explain each piece in the code so that I understand what I'm doing.
>> >
>> > Thanks so much.
>> >
>> > Ellen
>> >
>> >


 
Reply With Quote
 
Ellen G
Guest
Posts: n/a
 
      30th Nov 2007
Perfect! That worked beautifully. Thanks so much.

Ellen

"Pete_UK" wrote:

> You can do it with a hyperlink formula - no need for code. Suppose
> your blue section begins in A6 (i.e. the cell you want to jump to),
> then put this formula in the blue key cell:
>
> =HYPERLINK("#"&"A6","")
>
> If your red section begins at cell A46, then use this formula in the
> red key cell:
>
> =HYPERLINK("#"&"A46","")
>
> You can see how the formula varies - the cell reference is the cell
> you want to jump to, so put similar formulae in the other coloured
> cells of your key.
>
> If you click on the red key cell, your cursor will jump to A46. Click
> on another coloured key cell, and the cursor will jump to where that
> cell points to.
>
> Hope this helps.
>
> Pete
>
>
>
>
> On Nov 30, 4:29 pm, Ellen G <Ell...@discussions.microsoft.com> wrote:
> > Hi there --
> >
> > I have a color coded key at the top of my spreadsheet. One cell is blue, one
> > cell is red, etc. I would like the user to be able to click on one of those
> > cells and automatically jump to the appropriate section in the spreadsheet. I
> > saw another posting with the following code using validation:
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > ActiveCell.Offset(1, 0).Select
> > End Sub
> >
> > I was able to make this work by inserting something into the color-coded
> > cell. However, I have 5 color-coded cells and each needs to jump to a
> > different section of the spreadsheet.
> >
> > So I have a couple of questions:
> >
> > 1. First, can I automatically jump simply by clicking on the cell, without
> > having to insert something?
> > 2. How do I insert code for each individual jump?
> >
> > If you are able to provide code and guidance it would be most helpful if you
> > could explain each piece in the code so that I understand what I'm doing.
> >
> > Thanks so much.
> >
> > Ellen

>
>

 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      30th Nov 2007
You're welcome, Ellen - thanks for feeding back.

Pete

On Nov 30, 7:42 pm, Ellen G <Ell...@discussions.microsoft.com> wrote:
> Perfect! That worked beautifully. Thanks so much.
>
> Ellen
>
>
>
> "Pete_UK" wrote:
> > You can do it with a hyperlink formula - no need for code. Suppose
> > your blue section begins in A6 (i.e. the cell you want to jump to),
> > then put this formula in the blue key cell:

>
> > =HYPERLINK("#"&"A6","")

>
> > If your red section begins at cell A46, then use this formula in the
> > red key cell:

>
> > =HYPERLINK("#"&"A46","")

>
> > You can see how the formula varies - the cell reference is the cell
> > you want to jump to, so put similar formulae in the other coloured
> > cells of your key.

>
> > If you click on the red key cell, your cursor will jump to A46. Click
> > on another coloured key cell, and the cursor will jump to where that
> > cell points to.

>
> > Hope this helps.

>
> > Pete

>
> > On Nov 30, 4:29 pm, Ellen G <Ell...@discussions.microsoft.com> wrote:
> > > Hi there --

>
> > > I have a color coded key at the top of my spreadsheet. One cell is blue, one
> > > cell is red, etc. I would like the user to be able to click on one of those
> > > cells and automatically jump to the appropriate section in the spreadsheet. I
> > > saw another posting with the following code using validation:

>
> > > Private Sub Worksheet_Change(ByVal Target As Range)
> > > ActiveCell.Offset(1, 0).Select
> > > End Sub

>
> > > I was able to make this work by inserting something into the color-coded
> > > cell. However, I have 5 color-coded cells and each needs to jump to a
> > > different section of the spreadsheet.

>
> > > So I have a couple of questions:

>
> > > 1. First, can I automatically jump simply by clicking on the cell, without
> > > having to insert something?
> > > 2. How do I insert code for each individual jump?

>
> > > If you are able to provide code and guidance it would be most helpful if you
> > > could explain each piece in the code so that I understand what I'm doing.

>
> > > Thanks so much.

>
> > > Ellen- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jump to cell based on cell results created by calendar control too JB Microsoft Excel Misc 3 15th Jan 2008 08:18 PM
Auto Jump to Cell =?Utf-8?B?RGVubmlz?= Microsoft Excel Programming 5 18th Aug 2006 08:43 PM
How to auto-jump to next cell after list value choice AA Arens Microsoft Excel Discussion 0 13th May 2006 05:42 AM
how do i enfoce a"auto-tab or jump" to next cell =?Utf-8?B?TWlrZSBpbiBCYW5na29r?= Microsoft Excel Misc 5 22nd Mar 2006 09:42 AM
How do I double click a cell and jump to cell's referenced cell =?Utf-8?B?SmVycnlKdWljZQ==?= Microsoft Excel Misc 2 10th Sep 2005 10:24 PM


Features
 

Advertising
 

Newsgroups
 


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