I have an excel sheet named as "Task" which contains two tabs "Data" and "DB-Task". I want to copy data from sheet "Data" to "DB-Task". Sheet "Data" has five columns (e.g. A,B,C,D,E,F). I want that if some one enter data in first row it should be transferred to another tab. If any of the columns is not filled it should give a popup to enter values before transferring data to another sheet . And In case the second row has all data it should get transferred to another sheet and only give error for first row .
I am using below code for copying data and it is successfully copying data from one sheet to another . Now I am not sure how should I use if condition effectively so that I can achieve what I want
Dim sheet1 As Worksheet
Dim sheet2 As Worksheet
Dim endrow As Long
Set sheet1 = ActiveWorkbook.Sheets("Data")
Set sheet2 = ActiveWorkbook.Sheets("Delivery Task")
Application.ScreenUpdating = False
endrow = sheet2.Range("A" & sheet2.Rows.Count).End(xlUp).Row
sheet1.Range("A2:E10").Copy
sheet2.Activate
sheet2.Range("A" & endrow + 1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
sheet1.Activate
Range("A2:E10").ClearContents
End Sub