Forum Discussion
jmpjmp
Mar 14, 2023Copper Contributor
VBA Run-time error '1004' when Hide/Show Rows
Hello All, I am confronted with an error message - "Run-time error '1004': Unable to set the Hidden property of the Range class" when hiding/showing entire rows. Cells A1:A10 are given values...
- Mar 14, 2023
This is because the ListFillRange is set to A1:A10 and you are trying to hide those rows. An easy fix is to use On Error Resumen Next like below...
On Error Resume Next Rows(ShowRows).Hidden = False Rows(HideRows).Hidden = True On Error GoTo 0
Gilbert1240
Mar 19, 2023Copper Contributor
I managed to produce a formula in excel through the online excel tutorial, covering two of the three conditions. II miss now if the calculation is correct. I have now if the result of the calculation is >40 the result becomes 40, and if the result of the calculation is <0 (negative) the result becomes 0.
the formula I made is as follows:
=IF (180-G6/i6>40,"40",IF(180-G6/I6<0,"0"))
Please Help
HansVogelaar
Mar 19, 2023MVP
You probably want to return a number, not a text value such as "0" or "40".
Try
=MIN(MAX(180-G6/I6, 0), 40)
- Gilbert1240Mar 20, 2023Copper ContributorThank you very much.