How do I Go To a cell based on input in another cell?

G

Guest

An employee inputs data for 52 different weeks of the year. Each week's data
is input in various different places within the same spreadsheet or workbook.
I need a way for the employee to type a week number in cell A1 and have the
cursor leap or automatically hyperlink to the area of the spreadsheet where
data entry is needed for that week number specified in cell A1?

EXAMPLE: If "3" is input in cell A1, then the employee needs the cursor to
automatically go to the area of the spreadsheet where week 3 data needs to be
input.

How is this done automatically if there is input in cell A1?
 
G

Guest

This is a sample macro, not a full solution. It goes in Worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
places = Array("Z100", "V300", "AA500")
If Intersect(Target, Range("A1")) Is Nothing Then
Exit Sub
End If
i = Range("A1").Value
Range(places(i - 1)).Select
End Sub

If the user enters a 1,2,or,3 in A1, the routine jumps to Z100,V300, or
AA500 respectively. You only need to change the Array statement to conain
the starting place for each of the 52 weeks.

REMEMBER: this goes in worksheet code, not a standard module.
 
G

Gord Dibben

Right-click on your sheet tab and "View Code"

Copy/paste the code into that sheet module.


Gord Dibben MS Excel MVP
 
G

Guest

Awesome...it works
Thanks
Wickliffe


Gord Dibben said:
Right-click on your sheet tab and "View Code"

Copy/paste the code into that sheet module.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top