How can I use VB to hide Row 57 if cell A53 has a value of 1?

D

Dorothy

I have a pricing worksheet. If the person filling it out populates the QTY
field (cell A53) of the item in row 53 with a value of 1, then I want the
item in row 57 to "disappear", so it can't be selected also. Is there a VB
code I can use to accomplish this?

Thanks for your time!
 
J

Jacob Skaria

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$53" Then Rows(57).Hidden = (Target.Value = 1)
End Sub

If this post helps click Yes
 
D

Dorothy

Worked perfectly. Thanks!!

Jacob Skaria said:
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$53" Then Rows(57).Hidden = (Target.Value = 1)
End Sub

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top