Hi.
I use the blow code to paste data from a textbox in a user from to a specific cell on sheet 1.
I would like to refine this to:
Paste to the active worksheet, instead of just Sheet1
and
Paste to Cell N15 (of active sheet), only if empty. If not empty check if N25 is empty and then paste. If both Cells contain data, then error message box.
Thanks
I use the blow code to paste data from a textbox in a user from to a specific cell on sheet 1.
I would like to refine this to:
Paste to the active worksheet, instead of just Sheet1
and
Paste to Cell N15 (of active sheet), only if empty. If not empty check if N25 is empty and then paste. If both Cells contain data, then error message box.
Thanks
Code:
Private Sub AddButton2_Click()
Sheets("Sheet1").Select
Range("N15").Value = txtSampleNo.Text
End Sub