Selecting the next empty cell in a row / vba

Solved/Closed
oscarr Posts 1 Registration date Friday 22 January 2010 Status Member Last seen 23 January 2010 - 23 Jan 2010 à 15:37
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 31 Jan 2010 à 13:10
Hello and thanks to anyone who can help,
I am using Excel 2002
The code below works fine except I want to select the next empty cell to the right in the row each time the same player's score is entered.
As it reads now, it just overwrites the previous entry.


Sheets("Classic").Select
ActiveSheet.Unprotect

Range("B1").Select
Do Until ActiveCell.Value = Player.Value
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Value = Player.Value
Activecell.offset(0,4).value=Score.value

ActiveSheet.Protect

GameNumber.Value = ""
Player.Value = ""
Score.Value = ""

Hoping someone can assist,

Regards,

Oscarr
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
31 Jan 2010 à 13:10
TRY THIS

.
.
.
ActiveCell.Value = Player.Value
Activecell.offset(0,4).value=Score.value

'find last used cell on the row to the right
ActiveCell.End(xlToRight).Select

'move one cell to the right from the last used cell
ActiveCell.Offset(0, 1).Select

.
.