Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Calendar help

I have a spreadsheet (3 sheets) that helps people calculate time from a
time card (hours/days worked and alerts if too many or too few hours
are worked.) On the form I have a checkbox that allows users to select
if they want the sheet printed. I this box is selected it shows several
boxes where data can be listed; employee name, dates, etc. Is there a
way to lock/unlock these cells (as well as hide them) depending on the
condition of the checkbox?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calendar help


You would have lock/unlock them from the vba.

1. In the sheet, select All
2. Right click the cells to be locked, select "Format Cells".
3. Select the "Protection" tab
4. Click the checkbox for "Locked"

Now, from your code, you would need to input the following where you
checkbox control is.

Ex.
Sub CheckBox1()
If UserForm1.CheckBox1.Value = True Then
Sheets("Sheet1").Protect ("password")
Sheets("Sheet2").Protect ("password") 'continue with however many yo
need
Else:
Sheets("Sheet1").Unprotect ("password") 'both passwords must be th
same
Sheets("Sheet2").Unprotect ("password")
End If
End Sub


L Scholes Wrote:
I have a spreadsheet (3 sheets) that helps people calculate time from a
time card (hours/days worked and alerts if too many or too few hours
are worked.) On the form I have a checkbox that allows users to select
if they want the sheet printed. I this box is selected it show
several
boxes where data can be listed; employee name, dates, etc. Is there a
way to lock/unlock these cells (as well as hide them) depending on the
condition of the checkbox


--
dok11
-----------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058
View this thread: http://www.excelforum.com/showthread.php?threadid=52984

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Calendar help

This seems to have the effect of locking and locking all cells selected
for locking. I just want to unlock certain cells so that when the user
clicks the "Printable Version" check box it unlocks the blocks
necessary to enter for printing (names, dates, etc.) but leaves all
cells with code locked. Any ideas?


dok112 wrote:
You would have lock/unlock them from the vba.

1. In the sheet, select All
2. Right click the cells to be locked, select "Format Cells".
3. Select the "Protection" tab
4. Click the checkbox for "Locked"

Now, from your code, you would need to input the following where your
checkbox control is.

Ex.
Sub CheckBox1()
If UserForm1.CheckBox1.Value = True Then
Sheets("Sheet1").Protect ("password")
Sheets("Sheet2").Protect ("password") 'continue with however many you
need
Else:
Sheets("Sheet1").Unprotect ("password") 'both passwords must be the
same
Sheets("Sheet2").Unprotect ("password")
End If
End Sub


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
Convert date from Gregorian Calendar to Hijri Calendar H.Alkhodary Excel Discussion (Misc queries) 1 February 21st 09 10:11 AM
find free sharware to include calendar pop or use calendar in cell ednc Excel Discussion (Misc queries) 2 April 14th 08 05:05 PM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
excel calendar - list of names displayed on calendar Brian'88 Excel Worksheet Functions 3 November 17th 06 10:31 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM


All times are GMT +1. The time now is 11:17 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"