I have a loop code which enters a formula into each worksheet 3-31 in cell A17.
However, I need to protect cell A17, so no user enters data or deletes the results of the formula on accident.
I know I how to write a macro to allow this through the context of setting a certain worksheet.
But I don't know to do it in context of my current loop code:
The code
Cell A17 needs to return the results of a formula, but it needs to be protected.
However, I need to protect cell A17, so no user enters data or deletes the results of the formula on accident.
I know I how to write a macro to allow this through the context of setting a certain worksheet.
Code:
Dim Wks As Worksheet
Set Wks = Worksheets("My Data")
Wks.UnProtect Password:="password here"
But I don't know to do it in context of my current loop code:
The code
Code:
Dim i As Integer
For i = 3 To 31
Sheets(i).Range("A17").FormulaR1C1 = "=PULL(""'X:\Staff\AI Program\""&'Set-up Page'!R[-11]C[4]&""\[""&'Set-up Page'!R[-11]C[5]&""]""&R[-15]C[2]&""'!A17"")"
Next i
Cell A17 needs to return the results of a formula, but it needs to be protected.