Hello,
So I have two workbooks that I am using. They both contain sheets that are for 'READ ONLY' purposes, but can only be changed from macros.
I have one workbook that is only accessible to certain users and another workbook accessible to other users. I currently have a macro that adds and deletes to a certain column in the read only sheet by unprotecting it and then protecting it. Is there a way to add and delete to both workbooks whenever an item is added from either workbook?
Here is the code that I am using just for the macro to add to the workbook in which it belongs to:
Private Sub DAddLocateBTN_Click()
Sheets("-READ ONLY-").Unprotect "123steel"
If Len(DaddLocationTB.Value) Then
With Worksheets("-READ ONLY-")
'Add entry to combobox
Dlocationcb.AddItem DaddLocationTB.Value
DDelLocationcb.AddItem DaddLocationTB.Value
'Store entries on read only column f
.Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Value = DaddLocationTB.Value
'Clear textbox
Me.DaddLocationTB.Value = vbNullString
End With
End If
Sheets("-READ ONLY-").Protect "123steel"
End Sub
and the code to delete items:
Private Sub DdelLocateBTN_Click()
Sheets("-READ ONLY-").Unprotect "123steel"
Worksheets("-Read Only-").Range("C" & DDelLocationcb.ListIndex + 2).Delete
DDelLocationcb.Value = ""
Call Dload
'finds the selected item and deletes from spreadsheet.
Sheets("-READ ONLY-").Protect "123steel"
End Sub
This code belongs to my work book: "data"
and I want it to sync with my other work book "MillSteel-Reports"
I have attached the workbooks:
Passwords for the read only sheets are "123steel"
and password for the MillSteel-Report Workbook is "steel123"
My question might not be too clear, so my apologies in advance
Please Help
Bookmarks