Macro to select a cell in a table from a reference in a different

R

Robert_NSBG

Im trying to create a scoring sheet to score my daughters basketball games.
I'm stuck, the score sheet is basically a table with 4 columns (periods 1
thru 4) and 12 rows (the 12 girls on the team).

In a cell (input cell 1) outside of the table, I manually enter 1,2,3 or 4
depending on the period we are playing.

I need the macro to select the column in the table(1 thru 4) based on the
period number I entered in input cell 1, next I need the macro to go down a
given number of rows (also specified in another cell; input cell 2)

Please Help !!!!
 
P

Per Jessen

Hi

Try if this will help you (It's an event code, so it has to go into the
codesheet for the desired sheet):

Private Sub Worksheet_Change(ByVal Target As Range)
Set isect = Intersect(Target, Range("F1", "F2"))
If Not isect Is Nothing Then
If Range("F1") <> "" And Range("F2") <> "" Then
TargetCol = Range("F1").Value + 1 ' Names in Column A
TargetRow = Range("F2").Value + 1 ' Headers in Row 1
Cells(TargetRow, TargetCol).Select
End If
End If
End Sub

Regards,
Per
 

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