Hi Everyone.
Love the forum. I am usually on the outside checking out the solutions to help resolve my own creations, but this one has me stumped.
The code works perfectly when the sheet is unprotected. However as protection is a pre-requisite, I keep encountering the ol' dreaded
"Run-time errror '1004': Unable to set the Hidden property of the Range class"
I have tried a number of options to work around this but with no success.
I hope someone can help me figure it out.
The macro is tied to a dropdown list. User selection then displays one of 3 alternatives.
There is also a command button which is tied to the table which allows the user to add rows. This functions as required without issue. I have its visibility included in the code, just to ensure it stays hidden until needed.
thanks
Nik
Love the forum. I am usually on the outside checking out the solutions to help resolve my own creations, but this one has me stumped.
The code works perfectly when the sheet is unprotected. However as protection is a pre-requisite, I keep encountering the ol' dreaded
"Run-time errror '1004': Unable to set the Hidden property of the Range class"
I have tried a number of options to work around this but with no success.
I hope someone can help me figure it out.
The macro is tied to a dropdown list. User selection then displays one of 3 alternatives.
There is also a command button which is tied to the table which allows the user to add rows. This functions as required without issue. I have its visibility included in the code, just to ensure it stays hidden until needed.
thanks
Nik
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("MobileSelection"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "-- Selection Required --":
Rows("15:28").EntireRow.Hidden = True
Columns("M:U").EntireColumn.Hidden = True
CommandButton1.Visible = False
Case Is = "Mobile Fleet Without Porting":
Rows("15:28").EntireRow.Hidden = False
Columns("M:U").EntireColumn.Hidden = True
CommandButton1.Visible = True
Case Is = "Mobile Fleet With Porting":
Rows("15:28").EntireRow.Hidden = False
Columns("M:U").EntireColumn.Hidden = False
CommandButton1.Visible = True
End Select
End If
End Sub
Last edited by a moderator: