Ok, try this
Private Sub CommandButton2Ok_Click()
Dim emptyRow As Long
If Len(ComboBox1Month) = 0 Then
MsgBox "No month selected"
Exit Sub
End If
emptyRow = Month(ComboBox1Month) + 2
'Transfer information
With Sheet12
If Len(TextBox1AppleS) > 0 Then .Cells(emptyRow, 3).Value = .Cells(emptyRow, 3).Value + CLng(TextBox1AppleS.Value + 0)
If Len(TextBox2AppleB) > 0 Then .Cells(emptyRow, 4).Value = .Cells(emptyRow, 4).Value + CLng(TextBox2AppleB.Value + 0)
End With
'Make Sheet13 active
With Sheet13
If Len(TextBox3OrangeS) > 0 Then .Cells(emptyRow, 3).Value = .Cells(emptyRow, 3).Value + CLng(TextBox3OrangeS.Value)
If Len(TextBox4IOrangeB) > 0 Then .Cells(emptyRow, 4).Value = .Cells(emptyRow, 4).Value + CLng(TextBox4IOrangeB.Value)
End With
'Make Sheet18 active
With Sheet18
If Len(TextBox5PearS) > 0 Then .Cells(emptyRow, 3).Value = .Cells(emptyRow, 3).Value + CLng(TextBox5PearS.Value)
If Len(TextBox6PearM) > 0 Then .Cells(emptyRow, 4).Value = .Cells(emptyRow, 4).Value + CLng(TextBox6PearM.Value)
If Len(TextBox7PearB) > 0 Then .Cells(emptyRow, 5).Value = .Cells(emptyRow, 5).Value + CLng(TextBox7PearB.Value)
End With
End Sub
Bookmarks