ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I use VB to hide Row 57 if cell A53 has a value of 1? (https://www.excelbanter.com/excel-programming/434347-how-can-i-use-vbulletin-hide-row-57-if-cell-a53-has-value-1-a.html)

Dorothy

How can I use VB to hide Row 57 if cell A53 has a value of 1?
 
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!

Jacob Skaria

How can I use VB to hide Row 57 if cell A53 has a value of 1?
 
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
---------------
Jacob Skaria


"Dorothy" wrote:

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!


Dorothy

How can I use VB to hide Row 57 if cell A53 has a value of 1?
 
Worked perfectly. Thanks!!

"Jacob Skaria" wrote:

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
---------------
Jacob Skaria


"Dorothy" wrote:

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!



All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com