I have the following code in a workbook. When pressing "update" the data entered should populate rows on a another sheet to adjacent cells, as in columns E, F, G etc but instead populates E, G, I, etc, missing alternate columns out. Can anybody tell me where in the code its going wrong please? (I've little knowledge working with VBA. Thank you.
Sub Master_Update()
Dim a, b
Dim i As Long, irow As Long
Dim player As String
Application.ScreenUpdating = False
player = Range("Player")
a = Range("Shots")
ReDim b(1 To 18)
With Sheets("Master")
.Activate
irow = Application.Match(player, Range("B:B"), 0)
For i = 1 To 18
.Cells(irow, (i - 1) * 2 + 5) = a(i, 1)
b(i) = .Cells(irow, i + 61)
Next i
End With
With Sheets("Score Enter")
.Cells(3, "C").Resize(18, 1) = Application.Transpose(b)
.Activate
End With
Application.ScreenUpdating = True
End Sub
Sub Clear_Shots()
Range("Shots").ClearContents
Range("Points").ClearContents
End Sub
Sub Master_Update()
Dim a, b
Dim i As Long, irow As Long
Dim player As String
Application.ScreenUpdating = False
player = Range("Player")
a = Range("Shots")
ReDim b(1 To 18)
With Sheets("Master")
.Activate
irow = Application.Match(player, Range("B:B"), 0)
For i = 1 To 18
.Cells(irow, (i - 1) * 2 + 5) = a(i, 1)
b(i) = .Cells(irow, i + 61)
Next i
End With
With Sheets("Score Enter")
.Cells(3, "C").Resize(18, 1) = Application.Transpose(b)
.Activate
End With
Application.ScreenUpdating = True
End Sub
Sub Clear_Shots()
Range("Shots").ClearContents
Range("Points").ClearContents
End Sub