Selecting the next empty cell in a row / vba

Solved/Closed
oscarr Posts 1 Registration date Friday January 22, 2010 Status Member Last seen January 23, 2010 - Jan 23, 2010 at 03:37 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jan 31, 2010 at 01:10 PM
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 January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jan 31, 2010 at 01:10 PM
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

.
.
5