Private Sub cmdSubmitPL_Click()
Dim ws As Worksheet
Dim i As Integer, j As Integer
Dim row_arr As Variant
row_arr = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, _
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, _
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, _
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, _
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, _
121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, _
141, 142, 143)
Set ws = Sheets("MASTER")
For j = 1 To 143
If combobox3.Value = Worksheets("PLHeadings").Range("C" & j + 3) Then
For i = 1 To 12
If Me.Controls("txtY1M" & i).Value <> "" Then
ws.Cells(row_arr(j), 19 + i).Value = Me.Controls("txtY1M" & i).Value
End If
If Me.Controls("txtY2M" & i).Value <> "" Then
ws.Cells(row_arr(j), 31 + i).Value = Me.Controls("txtY2M" & i).Value
End If
If Me.Controls("txtY3M" & i).Value <> "" Then
ws.Cells(row_arr(j), 43 + i).Value = Me.Controls("txtY3M" & i).Value
ws.Cells(row_arr(j), 55 + i).Value = Me.Controls("txtY4M" & i).Value
ws.Cells(row_arr(j), 67 + i).Value = Me.Controls("txtY5M" & i).Value
End If
Next
End If
Next j
End Sub
Bookmarks