Sub HideNos()
For i = 1 to Range("A65536").end(xlup).Row
If UCase(Cells(1, i).value) = "NO" then Cells(1, i).entireRow.Hide
Next i
End Sub
I wrote this then got confused because you say "A1=No then hide row A" but A is a column. Do you want to hide the columns? Or do you want to hide row 1, and if A3=No then hide row 3? My code goes through column A and hides all of the rows where the value of A equals to No.
Five and a half years later, I dont know if the guys that started this thread are still around, but I have a supplimentary question.
Is it possible to adapt the code below so that if it is run more than once it analyses all previously hidden rows and reinstates them if all rows do not contain "No"?
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.