Can anyone help, I am still quite novice and cant solve this problem:
I have writen a VBA where a user inputs data into a form, presses a button, and then the data is inputted into a spreadsheet. I have the code sorted for this with the data being written to a spreadsheet which is part of the same book and can even modify it so that the data is written to another workbook if that book is open (using: "Windows("Book2").Activate" ). What I really need to do is to perform the operations (selecting cells and write the data) in a closed spreadsheet and saving the data.
How can I do this?
The code I have so far, writing the inputted data into a different sheet in the same book is as follows:
Private Sub Enter_Click()
WO = TextBox1.Text
Datein = DateBox.Text
Unit = UnitBox.Text
Sheets("All Records").Rows("5:5").Insert Shift:=xlDown
Sheets("All Records").Range("A5").Value = WO
Sheets("All Records").Range("B5").Value = Datein
Sheets("All Records").Range("C5").Value = Unit
ActiveWorkbook.Save
End Sub
Thanks for your help
I have writen a VBA where a user inputs data into a form, presses a button, and then the data is inputted into a spreadsheet. I have the code sorted for this with the data being written to a spreadsheet which is part of the same book and can even modify it so that the data is written to another workbook if that book is open (using: "Windows("Book2").Activate" ). What I really need to do is to perform the operations (selecting cells and write the data) in a closed spreadsheet and saving the data.
How can I do this?
The code I have so far, writing the inputted data into a different sheet in the same book is as follows:
Private Sub Enter_Click()
WO = TextBox1.Text
Datein = DateBox.Text
Unit = UnitBox.Text
Sheets("All Records").Rows("5:5").Insert Shift:=xlDown
Sheets("All Records").Range("A5").Value = WO
Sheets("All Records").Range("B5").Value = Datein
Sheets("All Records").Range("C5").Value = Unit
ActiveWorkbook.Save
End Sub
Thanks for your help