User Function returning #Value

tomexcel1

New Member
Joined
Feb 22, 2018
Messages
47
Hi All

I am currently using the below function to show if a row is hidden or not, when i first use the function it works perfectly but as soon as i unhide/hide a row all the values change to #VALUE . What am i doing wrong?

Code:
Public Function isvisible(rng As Range)
isvisible = Not (rng.EntireRow.Hidden)
End Function

Thanks All
Tom
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Have you tried putting ByRef or ByVal in? Try both and see
I would also specify the type of value returned by the function

Public Function isvisible(ByVal rng As Range) as Boolean
Public Function isvisible(ByRef rng As Range) as Boolean
 
Last edited:
Upvote 0
Hi Johnny

Thanks for those, still doesn't seem to work. I can make the #value go away when i click in to the cell and back out again. Cant understand why its doing this?

Thanks
Tom
 
Upvote 0
I'm not sure. It works for me in that I don't get an error, however I selected 3 lines and hid them. it returned TRUE, good. I unhid all 3 and it said FALSE, good. However when I start hiding odd ones it becomes unpredictable, it says whether the majority are hidden or not.
 
Upvote 0

Forum statistics

Threads
1,223,701
Messages
6,173,920
Members
452,539
Latest member
deeme

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