Hi All,
I have a list of users in a table. The appropriate User is found by using a For Each loop (this is working). Now, once the User is found, I have the row (that the User is in). I now need to find the first available/emply cell to the right, in this row. I need to search for the next available cell in this row because a new date ("stamp") will be placed in this row each day. Ultimately, I will have a whole row of dates to the right of each user.
I have explored a number of options to do this... but can't figure it out.
VBA code:
Set rng = Worksheets("sheet1").Range("I4:I21") 'This is the table of users.
irow = 4 'First row of Users
icol = 9 'The Column where the User is identified. The User Table never changes. Every date will be somewhere to the right of this Column.
For Each cell In rng
'Find the Row containing the user's NUID
If cell.Value = NUID Then
'LastBlnkCol = Cells(irow, icol)
' Do Until IsEmpty(ActiveCell) = True
' ActiveCell.Offset(irow, 9).Select
'r = r + 1
'Loop
'LastBlnkCol = Cells(irow, icol.Count).End(xlToLeft).Column + 1
'range(
'
End If
irow = irow + 1
Next cell
Any help is greatly appreciated!
I have a list of users in a table. The appropriate User is found by using a For Each loop (this is working). Now, once the User is found, I have the row (that the User is in). I now need to find the first available/emply cell to the right, in this row. I need to search for the next available cell in this row because a new date ("stamp") will be placed in this row each day. Ultimately, I will have a whole row of dates to the right of each user.
I have explored a number of options to do this... but can't figure it out.
VBA code:
Set rng = Worksheets("sheet1").Range("I4:I21") 'This is the table of users.
irow = 4 'First row of Users
icol = 9 'The Column where the User is identified. The User Table never changes. Every date will be somewhere to the right of this Column.
For Each cell In rng
'Find the Row containing the user's NUID
If cell.Value = NUID Then
'find the first empty cell in this Row to the right.
'Cells(irow, Range("??").End(xlToRight).Column + 1).Select'LastBlnkCol = Cells(irow, icol)
' Do Until IsEmpty(ActiveCell) = True
' ActiveCell.Offset(irow, 9).Select
'r = r + 1
'Loop
'LastBlnkCol = Cells(irow, icol.Count).End(xlToLeft).Column + 1
'range(
'
Enter the date.
Selection = stampEnd If
irow = irow + 1
Next cell
Any help is greatly appreciated!