Selecting the next empty cell in a row / vba [Solved/Closed]

Report
Posts
1
Registration date
Friday January 22, 2010
Status
Member
Last seen
January 23, 2010
-
rizvisa1
Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
-
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

1 reply

Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
756
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
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 4222 users have said thank you to us this month