Hello,
I have a few small things I need help with. So, I have 3 pc's each with a workbook; Station1, Station2 & Station3 and each work book has 2 sheets. Sheet 1 has 3 cells which can be edited by the user the rest of the sheet is protected. I have set up a macro linked to a command button called "print" which prints the label with the data entered and then copies the data into a table on Sheet2 for the record.
1) Currently it does just the above, however I would like it to first check if the data entered into cell Q3 (example) matches anything in column B on Sheet2, if it does then don't copy anything just print the label requested. (In-case the user needs to print a label twice, I don't want it to copy the same data twice).
2) Once every hour I want the data from Sheet2 on all 3 pc's to be saved on a shared drive into 1 workbook and then that same workbook be updated every hour. (if that's possible)
3)Would it be possible to make Sheet2 read-only and still record data into it with the macro? I want to prevent anyone from tampering with the data in Sheet2. (currently just using the hide sheet method and trusting everyone not to mess about with it) I tried to protect it but get an error when the macro runs.
Feel free to "clean up" the code if needed. This is just what I came up with by searching the web and following some tutorials.
If you need anymore information to help me with this then please just ask.
Thank you for taking the time to read this.
I have a few small things I need help with. So, I have 3 pc's each with a workbook; Station1, Station2 & Station3 and each work book has 2 sheets. Sheet 1 has 3 cells which can be edited by the user the rest of the sheet is protected. I have set up a macro linked to a command button called "print" which prints the label with the data entered and then copies the data into a table on Sheet2 for the record.
1) Currently it does just the above, however I would like it to first check if the data entered into cell Q3 (example) matches anything in column B on Sheet2, if it does then don't copy anything just print the label requested. (In-case the user needs to print a label twice, I don't want it to copy the same data twice).
2) Once every hour I want the data from Sheet2 on all 3 pc's to be saved on a shared drive into 1 workbook and then that same workbook be updated every hour. (if that's possible)
3)Would it be possible to make Sheet2 read-only and still record data into it with the macro? I want to prevent anyone from tampering with the data in Sheet2. (currently just using the hide sheet method and trusting everyone not to mess about with it) I tried to protect it but get an error when the macro runs.
Code:
Private Sub CommandButton2_Click()
Range("Q4").Select
For i = 1 To Range("Q4")
Sheets(1).Range("A13") = i
'Application.ActivePrinter = "HP:"
Sheets("Sheet1").PrintOut
Next i
erw = Sheet2.Cells(1, 1).CurrentRegion.Rows.Count + 1
Sheet2.Cells(erw, 1) = Range("Q2")
Sheet2.Cells(erw, 2) = Range("Q3")
Sheet2.Cells(erw, 3) = Range("Q4")
Sheet2.Cells(erw, 4) = Range("A14")
Range("Q3") = ""
Range("Q4") = ""
End Sub
If you need anymore information to help me with this then please just ask.
Thank you for taking the time to read this.