Results 1 to 6 of 6

Thread: VBA - HIDE/UNHIDE Rows Based on Output of a Formulated Cell

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    VBAX Newbie
    Joined
    Feb 2017
    Posts
    3
    Location
    Thank you so much for your help!!!
    I am having another issue when I input the new code (have amended some of the range rows stated above)
    Runtime error 2147417848 (80010108) Method Hidden of Object Range failed.
    When I remove Macro I get a Runtime error 1004 - Unable to set the Hidden property of Range class.
    I have attached the document form as probably easier for you to look at - My formulas are stored under hidden columns K-S.
    Really appreciate your help with this.

    Private Sub Worksheet_Calculate() 
        If Cells(17, 5).Value = "Non Significant Change - Minor Local Governance applies" Then 
            Range("1:18,29:29,31:123,131:163").EntireRow.Hidden = False 
            Range("19:28,30:30,124:130,164:313").EntireRow.Hidden = True 
            
        ElseIf Cells(17, 5).Value = "Significant Change - complete the additional materiality questions below" Then 
            Range("1:17,19:26").EntireRow.Hidden = False 
            Range("18:18,27:313").EntireRow.Hidden = True 
            
        ElseIf Cells(26, 5).Value = "Significant Non Material [Standard]" Then 
            Range("1:17,19:27,30:123,131:312").EntireRow.Hidden = False 
            Range("18:18,28:29,124:130,313:313").EntireRow.Hidden = True 
            
        ElseIf Cells(26, 5).Value = "Significant Change - Material" Then 
            Range("1:17,19:26,28:28,30:123,131:311,313:313").EntireRow.Hidden = False 
            Range("18:18,27:27,29:29,124:130,312:312").EntireRow.Hidden = True 
        End If 
    End Sub
    Attached Files Attached Files
    Last edited by HazelOC; 02-17-2017 at 07:15 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •