I can not seem to figure this out. I'm trying to make this code as simple as possible, without using loops or "If" statements, but cannot seem to figure out how to reference every odd numbered column. I've got a sheet that has a list of "Player's Names" in column A. I have headers going across each column alternating "Win", "Loss", "Win", "Loss", etc... The number of Win/Loss columns is determined by a number of matches entered into a TextBox in my UserForm. So if the number of matches entered in the textbox is 3 then I'd have 6 columns starting in "B", Win, Loss, so on and so forth. Then in my Userform, I've got a 2 listboxes. 1 has the list of players names, and the 2nd one has a list of how many matches there are (1, 2, 3, etc.). What I want to do is be able to select a player in the first listbox, and then select what match I'm updating in the 2nd listbox then enter the number of wins into a textbox and a number of losses in a 2nd textbox, and then when I click submit it should add the number of wins and losses to the corresponding columns on that player's row. So if I select the first player, and match 2, and enter 2 wins and 1 loss into the textboxes, it should update column 4 for the "Wins" entered and column 5 for the "Losses" entered.
This is what I've gotten so far, and it works for my "Win" columns, but can't seem to figure out how to reference the odd numbered columns.
This is what I've gotten so far, and it works for my "Win" columns, but can't seem to figure out how to reference the odd numbered columns.
Code:
Private Sub btn_Submit_Click()
Dim i As Integer
Dim j As Integer
i = Me.lb_Players.ListIndex + 1
j = Me.lb_Rounds.ListIndex + 1
ws.Cells(i + 1, j * 2) = Me.tb_Wins
End Sub