I am trying to write code where the user enters data into 3 text boxes, then presses a button. The data inputted is then written in that worksheet and then another worksheet in the same file.
When run, the data is written in the cells of the 1st spreadsheet but then i get a bug on the "Range("B4").Activate" line when in the 2nd worksheet.
Any advice?
Private Sub Enter_Click()
Datein = DateBox.Text
Unit = UnitBox.Text
Failure = FailureBox.Text
Sheets("Form").Select
Range("B4").Activate
ActiveCell.FormulaR1C1 = Datein
Range("C4").Activate
ActiveCell.FormulaR1C1 = Unit
Range("D4").Activate
ActiveCell.FormulaR1C1 = Failure
Sheets("All Failure Records").Select
Range("B4").Activate
ActiveCell.FormulaR1C1 = Datein
Range("C4").Activate
ActiveCell.FormulaR1C1 = Unit
Range("D4").Activate
ActiveCell.FormulaR1C1 = Failure
End Sub
When run, the data is written in the cells of the 1st spreadsheet but then i get a bug on the "Range("B4").Activate" line when in the 2nd worksheet.
Any advice?
Private Sub Enter_Click()
Datein = DateBox.Text
Unit = UnitBox.Text
Failure = FailureBox.Text
Sheets("Form").Select
Range("B4").Activate
ActiveCell.FormulaR1C1 = Datein
Range("C4").Activate
ActiveCell.FormulaR1C1 = Unit
Range("D4").Activate
ActiveCell.FormulaR1C1 = Failure
Sheets("All Failure Records").Select
Range("B4").Activate
ActiveCell.FormulaR1C1 = Datein
Range("C4").Activate
ActiveCell.FormulaR1C1 = Unit
Range("D4").Activate
ActiveCell.FormulaR1C1 = Failure
End Sub