Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Enetring data in an expanding table
This is my table
Rider Lap 1 Lap2 ........ 100 101 102 I need to select the cell to store data in based on rider number and then the first free lap time cell. ie. lap 1 time in lap1 and then when get to next lap determine next available cell over and put lap2 time. If it helps rider is in column h and 100 is in row 5. Thanks yet again |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Enetring data in an expanding table
The below code identifies the next free column in the current row..where the
cell is selected...and input the time. lngCol = ActiveSheet.Cells(ActiveCell.Row, _ Columns.Count).End(xlToLeft).Column + 1 ActiveSheet.Cells(ActiveCell.Row,lngCol) = Now() If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: This is my table Rider Lap 1 Lap2 ........ 100 101 102 I need to select the cell to store data in based on rider number and then the first free lap time cell. ie. lap 1 time in lap1 and then when get to next lap determine next available cell over and put lap2 time. If it helps rider is in column h and 100 is in row 5. Thanks yet again |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Enetring data in an expanding table
This could be assigned to a button to ask for the lap time and rider number
and will put the lap time in the 1st available column when the rider number match is made: Sub AddLaps() Dim ridersRange As Range Dim riderCell As Range Dim lapTime As String Dim riderNumber As String lapTime = InputBox$("Enter lap time", "Lap Time", "") riderNumber = InputBox$("Enter Rider Number", "Rider", "") If lapTime = "" Or riderNumber = "" Then Exit Sub End If Set ridersRange = Range("H5:" & _ Range("H" & Rows.Count).End(xlUp).Address) Set riderCell = ridersRange.Find(riderNumber, , xlValues) If Not riderCell Is Nothing Then Range("G" & riderCell.Row).End(xlToRight).Offset(0, 1) = lapTime End If Set ridersRange = Nothing Set riderCell = Nothing End Sub "Jacob Skaria" wrote: The below code identifies the next free column in the current row..where the cell is selected...and input the time. lngCol = ActiveSheet.Cells(ActiveCell.Row, _ Columns.Count).End(xlToLeft).Column + 1 ActiveSheet.Cells(ActiveCell.Row,lngCol) = Now() If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: This is my table Rider Lap 1 Lap2 ........ 100 101 102 I need to select the cell to store data in based on rider number and then the first free lap time cell. ie. lap 1 time in lap1 and then when get to next lap determine next available cell over and put lap2 time. If it helps rider is in column h and 100 is in row 5. Thanks yet again |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Enetring data in an expanding table
How about a drop down list tied to a macro to find the selection and then
find the 1st free column? -- Don Guillett Microsoft MVP Excel SalesAid Software "NDBC" wrote in message ... This is my table Rider Lap 1 Lap2 ........ 100 101 102 I need to select the cell to store data in based on rider number and then the first free lap time cell. ie. lap 1 time in lap1 and then when get to next lap determine next available cell over and put lap2 time. If it helps rider is in column h and 100 is in row 5. Thanks yet again |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Enetring data in an expanding table
Thanks,
Just what I needed. "JLatham" wrote: This could be assigned to a button to ask for the lap time and rider number and will put the lap time in the 1st available column when the rider number match is made: Sub AddLaps() Dim ridersRange As Range Dim riderCell As Range Dim lapTime As String Dim riderNumber As String lapTime = InputBox$("Enter lap time", "Lap Time", "") riderNumber = InputBox$("Enter Rider Number", "Rider", "") If lapTime = "" Or riderNumber = "" Then Exit Sub End If Set ridersRange = Range("H5:" & _ Range("H" & Rows.Count).End(xlUp).Address) Set riderCell = ridersRange.Find(riderNumber, , xlValues) If Not riderCell Is Nothing Then Range("G" & riderCell.Row).End(xlToRight).Offset(0, 1) = lapTime End If Set ridersRange = Nothing Set riderCell = Nothing End Sub "Jacob Skaria" wrote: The below code identifies the next free column in the current row..where the cell is selected...and input the time. lngCol = ActiveSheet.Cells(ActiveCell.Row, _ Columns.Count).End(xlToLeft).Column + 1 ActiveSheet.Cells(ActiveCell.Row,lngCol) = Now() If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: This is my table Rider Lap 1 Lap2 ........ 100 101 102 I need to select the cell to store data in based on rider number and then the first free lap time cell. ie. lap 1 time in lap1 and then when get to next lap determine next available cell over and put lap2 time. If it helps rider is in column h and 100 is in row 5. Thanks yet again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Expanding and decreasing data | Excel Discussion (Misc queries) | |||
Expanding a data table to include an extra row | Excel Discussion (Misc queries) | |||
Counting Last n Rows in Expanding Table | Excel Discussion (Misc queries) | |||
Expanding data | Excel Worksheet Functions | |||
Excel formula in an expanding table | Excel Discussion (Misc queries) |