Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Protect several objects

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

..

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Protect several objects

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

Jarle wrote:

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

.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Protect several objects

Thanks again, Dave!

Dave Peterson skrev:

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

Jarle wrote:

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

.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect Drawing Objects bug in 2003? Don[_30_] Excel Programming 0 August 9th 07 05:12 PM
Protect Excel 2000 Objects Rodrigo Excel Programming 0 July 18th 05 05:48 PM
Protect Objects so they cannot be resized Carolyn A Charts and Charting in Excel 0 February 4th 05 08:53 PM
How can I protect objects differently? Frustrated User Excel Programming 1 November 6th 04 04:41 PM
Unable to remove Sheet objects in the Microsoft Excel Objects Adrian[_7_] Excel Programming 1 August 26th 04 10:49 PM


All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"