Hi excel users.
I have a macro that I want to run with worksheet protection on. I am using the following code to enable macros to work with protection on. It works for cells but not a shapes text box I have. Any ideas on how to make this work for textBox 1 also?
Thanks.
I have a macro that I want to run with worksheet protection on. I am using the following code to enable macros to work with protection on. It works for cells but not a shapes text box I have. Any ideas on how to make this work for textBox 1 also?
Thanks.
Code:
Private Sub Workbook_Open()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Protect Password:="password", _
UserInterFaceOnly:=True
Next wSheet
End Sub
Code:
Public Sub words()
ActiveSheet.Range("b2") = "sds"
ActiveSheet.Shapes("TextBox 1").TextFrame.Value = "sds"
End Sub