Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Heyas,
Hokay, noob behind the keyboard here and I have a situation I have no clue on how to fix. I have only had minimal training in visual basic. So any explanations in monosyllabic terms will be greatly appreciated. Situation: I'm making a spreadsheet and want to limit access by users to change data. I have a button that will generate data in the necessary fields. I have an checkbox that when selected should disable the commandbutton from functioning as well as locking the fields that had information generated in them. Here is the catch. When the sheet is unprotected the button and checkbox do not lock the data fields or diable the command button, but no error. But when I turn on the protection, I get an error '1004' Unable to set the Locked property of the range class when I click on the checkbox every time. Here is the code: Private Sub CheckBox1_Click() ' chkLockAttribs_Click() ActiveWindow.ScrollRow = 8 Sheets("Stats").Range("C18").Select If CheckBox1.Enabled = True Then Sheets("Stats").Range("C18, D19:D23, D25, D26:F26, J19:J23, P33, P35").Select Selection.Locked = True CommandButton1.Visible = False Else Sheets("Stats").Range("C18, D19:D23, D25, D26:F26, J19:J23, P33, P35").Select Selection.Locked = False CommandButton1.Visible = True End If Sheets("Stats").Range("D19").Select End Sub Any help would be greatly appreciated. Thanks. -SplatterKat- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checkbox in runtime | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Interior class error/runtime error 1004 | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming | |||
Unknown where is the problem on the Runtime error - Automation error | Excel Programming |