What I am attempting to do is create one VBA script attached to a button that will toggle to either hide or unhide cells based on it containing zero. I have created the simply script below that works but it takes to long to run as it goes line by line which you can see happening right before your eyes.
To try and speed things up I pieced together the following script but I could only get it to hide ALL the zeros in column "P" instead of a selected portion such as P76:P500. Then it would need to have code to toggle back and forth between hiding and unhiding zeros which I couldn't figure out.
Sub HideZeroRows() Dim LRow As Long LRow = Cells(Rows.Count, "P76:P276").End(xlUp).Row Application.ScreenUpdating = False Application.Calculation = xlCalculationManual For x = LRow To 1 Step -1 If Cells(x, "P76:P276").Value = "0" Then Rows(x).Hidden = True End If Next Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub
Thank You and look forward to your response.