Hi All ;
I am new in this useful community and i need your hepl plz .
i have a double click issue which erase a content of some cell only of some worksheet only after i locked the tab by password , the others tabs working as per normal , a content is hidden and locked .
i want some explanation and help . see below VBA , thank you in advance.
PS : in photo number 3 , all cells eve n sheet is locked and hidden , you can double click on each cell and content get erased / in photo number 2 , only some cell in green even sheet locked na hidden can get content erased after double click
I am new in this useful community and i need your hepl plz .
i have a double click issue which erase a content of some cell only of some worksheet only after i locked the tab by password , the others tabs working as per normal , a content is hidden and locked .
i want some explanation and help . see below VBA , thank you in advance.
PS : in photo number 3 , all cells eve n sheet is locked and hidden , you can double click on each cell and content get erased / in photo number 2 , only some cell in green even sheet locked na hidden can get content erased after double click
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("E5"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Reciprocating - gasoline": Range("34:37,41:46,48:50,53:55,57:57").EntireRow.Hidden = True
Range("38:40,47:47,51:52,56:56,58:58").EntireRow.Hidden = False
Case Is = "Turbine - natural gas": Range("34:35,37:37,41:42,46:46,48:50,53:55,57:57").EntireRow.Hidden = True
Range("36:36,38:40,45:45,47:47,51:52,56:56,58:58").EntireRow.Hidden = False
Case Is = "Recip - nat gas 4-stroke rich burn": Range("41:41,48:48,53:53,55:55").EntireRow.Hidden = True
Range("34:40,42:47,49:52,54:54,56:58").EntireRow.Hidden = False
Case Is = "Recip - nat gas 2-stroke lean burn": Range("34:54,56:58").EntireRow.Hidden = False
Range("55:55").EntireRow.Hidden = True
Case Is = "Recip - nat gas 4-stroke lean burn": Range("34:58").EntireRow.Hidden = False
Range("399:399").EntireRow.Hidden = True
Case Is = "Reciprocating - propane": Range("34:58").EntireRow.Hidden = False
Range("399:399").EntireRow.Hidden = True
Case Is = "Choose one": Range("34:58").EntireRow.Hidden = True
Range("399:399").EntireRow.Hidden = False
End Select
End If
If Range("E5:E5") = "Reciprocating - diesel" And Range("E7:E7") >= 600 Then
Range("34:37,41:46,48:50,53:55,57:57").EntireRow.Hidden = True
Range("38:40,47:47,51:52,56:56,58:58").EntireRow.Hidden = False
End If
If Range("E5:E5") = "Reciprocating - diesel" And Range("E7:E7") < 600 Then
Range("34:35,37:37,41:46,48:50,53:55,57:57").EntireRow.Hidden = True
Range("36:36,38:40,47:47,51:52,56:56,58:58").EntireRow.Hidden = False
End If
Dim rCell As Range
Set rCell = Range("J19")
Columns("K").EntireColumn.Hidden = True
If rCell.Value = 6 Then Columns("K").EntireColumn.Hidden = False
End Sub
Attachments
Last edited by a moderator: