I have the following code which of course based on a checkboxthe person
selects unprotects the worksheet, unhides the specified range of rows and
then reprotects the workbook. As well if they un-check that checkbox it
will rehide those rows. I am creating this for a group of employees.
Here is my code:
------------------------------------------------------
Private Sub CheckBox1_Click()
'More then 1000 pr year
If CheckBox1 = True Then
Worksheets("Estimate").Unprotect "ds789"
Range(Rows(118), Rows(142)).EntireRow.Hidden = False
ElseIf CheckBox1 = False Then
Range(Rows(68), Rows(142)).EntireRow.Hidden = True
Worksheets("Estimate").Protect "ds789"
End If
End Sub
Private Sub CheckBox2_Click()
'For Lots 25 to 1000 pr year
If CheckBox2 = True Then
Worksheets("Estimate").Unprotect "ds789"
Range(Rows(92), Rows(117)).EntireRow.Hidden = False
ElseIf CheckBox2 = False Then
Range(Rows(68), Rows(141)).EntireRow.Hidden = True
Worksheets("Estimate").Protect "ds789"
End If
End Sub
Private Sub CheckBox3_Click()
'For Lots 1 to 25 pr year
If CheckBox3 = True Then
Worksheets("Estimate").Unprotect "ds789"
Range(Rows(66), Rows(92)).EntireRow.Hidden = False
ElseIf CheckBox3 = False Then
Range(Rows(68), Rows(141)).EntireRow.Hidden = True
Worksheets("Estimate").Protect "ds789"
End If
End Sub
--------------------------------------------------
So now what I need to do is specify in there to only allow certain cells in
those rows to be filled in. For example if they check checkbox1 then I need
to unhide the rows specified but then only allow entry in the range c71:c77.
I am thinking there has to be a way to do but I only know certain areas of
visual basic programming code and its been as I go I learn. I would greatly
appreciate anyone's assistance with this.
~M
Bookmarks