ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to select a cell in a table from a reference in a different (https://www.excelbanter.com/excel-programming/420666-macro-select-cell-table-reference-different.html)

Robert_NSBG[_2_]

Macro to select a cell in a table from a reference in a different
 
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 !!!!

Per Jessen

Macro to select a cell in a table from a reference in a different
 
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

"Robert_NSBG" skrev i meddelelsen
...
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 !!!!




All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com