I am new to vba. My previous two vba codes are working.
I am trying to add this few lines to the current one
can anyone please help ? Thank you in advance
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String, Newvalue As String
'On Error GoTo Exitsub
Application.ScreenUpdating = False
If Target.Address = "$B$9" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Or Target.Value = "" Then
Application.EnableEvents = True
Exit Sub
Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
Application.EnableEvents = True
Else
Rows("40:89").EntireRow.Hidden = False
x = Range("B31").Value
Select Case x
Case ""
Rows("40:89").EntireRow.Hidden = True
Case 1 To 49
Rows(40 + x & ":89").EntireRow.Hidden = True
Case 50
End Select
End If
Application.ScreenUpdating = True
End Sub
I am trying to add this few lines to the current one
VBA Code:
y = Range("B5").Value
Select Case y
Case "OC FZ": Rows("12:93").EntireRow.Hidden = True
Case "FET": Rows("27:88").EntireRow.Hidden = True
End Select
Application.ScreenUpdating = True
End Sub
can anyone please help ? Thank you in advance
Last edited by a moderator: