Hi all,
I am running into problems trying to get the correct VBA code to protect table in my document, hiding the formula and abilty to edit whilst also making sure that macros included to add and remove data are still working.
So far if I protect my sheet I am unable to get macros to work. It displays error: Run-ime error '1004': Table features aren't available because the sheet is protected. When I go to debug .ListColumns(3).Delete is highlighted in yellow for this macro to reset table data.
Sub ResetTable()
Dim i As Long
With ThisWorkbook.Sheets("Table")
.Range("C6") = "England"
.Range("C8") = "Please Select"
With .ListObjects(1)
.Range(2, 2) = ""
For i = 3 To .DataBodyRange.Columns.Count
.ListColumns(3).Delete
Next i
End With
End With
End Sub
Any help is greatly appreciated
Thank you
Bookmarks