Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JasonMiller
 
Posts: n/a
Default Check Box that Locks all cells on it's column

Does anyone know how I could create a checkbox that when checked, would lock
all cells on that column permanently. Probably some simple macro that keeps
eluding me.
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Put a checkbox from the Forms toolbar in row 1 of each of the columns you want.

Then assign this same macro to each of those checkboxes.

Option Explicit
Sub testme()

Dim myCBX As CheckBox

Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)
If myCBX.Value = xlOn Then
ActiveSheet.Unprotect Password:="hi"
myCBX.TopLeftCell.EntireColumn.Locked = True
ActiveSheet.Protect Password:="hi"
End If

End Sub

Be aware that worksheet protection is very weak. It can be broke very simply.



JasonMiller wrote:

Does anyone know how I could create a checkbox that when checked, would lock
all cells on that column permanently. Probably some simple macro that keeps
eluding me.


--

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
HELP: Last row of the column containing blank cells between non-blank cells Space Ape Excel Worksheet Functions 2 May 27th 05 12:18 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
Count cells in a column that contain dates Cachod1 New Users to Excel 1 March 29th 05 08:56 PM
how can I take 3 cells and move them to a different column into 1 manz77 Excel Discussion (Misc queries) 1 January 27th 05 09:39 PM
calculate which cells in column A will give me the total of column Ken Excel Worksheet Functions 4 January 6th 05 06:25 AM


All times are GMT +1. The time now is 05:01 PM.

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"