Protect several objects

  • Thread starter Thread starter Jarle
  • Start date Start date
J

Jarle

I have several textboxes on a worksheet.

I will have to protect the text in these boxes with help of vba code. When
protecting text in one specific textbox I use:

Worksheets(1).Shapes("txtbox1").LockedText = True

I want to protect all boxes with one command. I am thinking about something
like

For each Textbox in Worksheets(1)
LockedText = True

I am struggling with the syntax to make this work. Can anybody help me out?

rgds
Jarle

..
 
Dim TBox As TextBox
For Each TBox In Worksheets("Sheet1").TextBoxes
TBox.LockedText = True
Next TBox
 
Thanks again, Dave!

Dave Peterson skrev:
Dim TBox As TextBox
For Each TBox In Worksheets("Sheet1").TextBoxes
TBox.LockedText = True
Next TBox
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top