Hi!

I have a spreadsheet of which you can enter sales figures via a UserForm.

In this form you can enter the sales figures each month for 5 years. It currently correctly 'pastes' whatever the user has typed into each month into the cells on the Master worksheet.

However... what if the user wants to leave one month blank or just work on years 1 and 2 and ignore 3, 4 and 5?

This also works fine, except the user may not want to input sales into years 3, 4 and 5 because the Master worksheet already has data in these cells and so what the UserForm VBA is doing when a TextBox is left blank is; overwriting whatever is in the cell on the Master worksheet with nothing... effectively removing the sales figure that was there in the first place.

How do I make the UserForm ignore and NOT overwrite blank TextBoxes into the cells where they should be 'pasted'.

Here is my code for when the user clicks 'Submit' (I'm currently trying to get year 1 working, then the remaining years will be easy):

Private Sub cmdSY1_5S1_Click()

Dim ws As Worksheet
Set ws = Worksheets("MASTER")

'Post user's input onto MASTER worksheet Row 17 Column T - AE:

'Year 1:

ws.Cells(17, 20).Value = txtY1M1.Value
ws.Cells(17, 21).Value = txtY1M2.Value
ws.Cells(17, 22).Value = txtY1M3.Value
ws.Cells(17, 23).Value = txtY1M4.Value
ws.Cells(17, 24).Value = txtY1M5.Value
ws.Cells(17, 25).Value = txtY1M6.Value
ws.Cells(17, 26).Value = txtY1M7.Value
ws.Cells(17, 27).Value = txtY1M8.Value
ws.Cells(17, 28).Value = txtY1M9.Value
ws.Cells(17, 29).Value = txtY1M10.Value
ws.Cells(17, 30).Value = txtY1M11.Value
ws.Cells(17, 31).Value = txtY1M12.Value

'Closes the form after user has entered data:

frmY1_5VATSalesType1.Hide

End Sub