When my form protects my spreadsheet after hitting the command button, it doesn't keep my protection settings. I need to allow users to format rows and edit objects. I searched online came up with adding to the last line below, but it isn't working. Please help!
Private Sub UpdateRatesCommandButton_Click()
Sheets("TA Form").Unprotect Password:="XXXX"
Worksheets("TA Form").Range("AV267").Value = AutomobileTextBox.Text
Worksheets("TA Form").Range("AV268").Value = AircraftTextBox.Text
Worksheets("TA Form").Range("AV269").Value = MovesTextBox.Text
Worksheets("TA Form").Range("AV270").Value = AllOthersTextBox.Text
Unload VehicleRatesUserForm
Sheets("TA Form").Protect Password:="XXXX", AllowEditObjects:=True, FormattingRows:=True
End Sub
Bookmarks