Hiding Row14 in Excel if Cell D13 is greater than 1

CMAnderson

New Member
Joined
Jan 11, 2019
Messages
6
I am creating a template to fill out for work. Looking to have Row 14 appear ONLY if Cell D13 is greater than "1".

Thanks in advance.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Welcome to the Board!

That will require VBA code, but when should the VBA code run?
When the workbook opens?
When the value in cell D13 is updated?
How exactly is the value in D13 updated (is it a manual edit, or the result of a formula)?
 
Upvote 0
Thank you! sorry, i am still fairly new at this... i will try to explain a little better..
Cell D13 will be blank when the worksheet opens. The end user of this form will need to tell how many lists a customer has provided. if the customer has only provided 1 list, i would like for row 14 to remain hidden. if the customer has provided more than 1 list, i would like for row 14 to appear so that more details regarding the list work will appear.
 
Upvote 0
Right-click on the Sheet tab name at the bottom of your screen, select "View Code", and paste this code in the resulting VB Editor window.
This should do what you want:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Run when cell D13 is updated
    If Not Intersect(Target, Range("D13")) Is Nothing Then
        If Range("D13") > 1 Then
            Rows("14").EntireRow.Hidden = False
        Else
            Rows("14").EntireRow.Hidden = True
        End If
    End If
    
End Sub
 
Upvote 0
this is great. Thank you, my only issue now is that the row i am hiding contains check boxes, when the row hides, the check boxes don't hide with the row, how can i fix this?

thanks in advance!
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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