Sub separation issues

OversizedCranium

New Member
Joined
Aug 18, 2015
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am very new to VBA so this is probably a quick fix, but I can't seem to get a second command to work underneath the first....

Is anyone able to help?

The first IF works perfectly, however I'm struggling to add another below it.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("C18"), Range(Target.Address)) Is Nothing Then
    Select Case Target.Value
    Case Is = "Residential": Rows("33:45").EntireRow.Hidden = True
                             Rows("19:32").EntireRow.Hidden = False
    Case Is = "Education": Rows("19:32").EntireRow.Hidden = True
                           Rows("33:37").EntireRow.Hidden = False
                           Rows("38:45").EntireRow.Hidden = True
    Case Is = "Res & Ed": Rows("19:37").EntireRow.Hidden = False
                          Rows("38:45").EntireRow.Hidden = True
    Case Is = "Part-Time": Rows("19:37").EntireRow.Hidden = True
                           Rows("38:45").EntireRow.Hidden = False
    Case Is = "None Required": Rows("19:45").EntireRow.Hidden = True
    
    End Select
    End If
    
  
End Sub

Private Sub Worksheet_Change_Bel(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("C52"), Range(Target.Address)) Is Nothing Then
    Select Case Target.Value
    Case Is = "No": Rows("53:55").EntireRow.Hidden = True
    Case Is = "Yes": Rows("53:55").EntireRow.Hidden = False
    
    End Select
    End If
    
    End Sub

Thanks
 
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,634
Messages
6,125,938
Members
449,275
Latest member
jacob_mcbride

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top