Wanting to dynamically hide rows

eat_cress

New Member
Joined
Dec 5, 2010
Messages
37
I have a spreadsheet which hides a particular row based on the value in another cell. The VBA I am using to do this is
PHP:
Private Sub Worksheet_Change(ByVal Target As Range)
       If Range("J8").Value > 0.8 Then
    Rows("29:30").EntireRow.Hidden = True
 
    Else
 
    Rows("29:30").EntireRow.Hidden = False
 
    End If
 
End Sub
The problem is that the value in the target cell changes based on the data in another sheet. When the target cell updates from opening the sheet the data comes from, it does not hide the rows. IT only seems to do that hiding of rows when I specifically go to the cell and either, reenter the code which links to the other sheet, or manually enter the number.
The row hiding is not updating when the target cell value changes when it comes from the other sheet.
Does anyone know how I would go about rectifying this?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If the cell contains a formula, you need to use the Worksheet_Calculate event (or use the change event monitoring the cells the formula depends on). The Calculate event does not give you a means of testing what changed, so it may slow your sheet down.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,357
Members
452,907
Latest member
Roland Deschain

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