Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default UDF to evaluate if row is hidden?

hi -

I'd like to build a UDF to evaluate (true/false) whether a cell is in
a hidden row ... I'll then use this UDF in a conditional format
statement to change the font color of a cell.

As example, I'll have a string in A20 (eg October) ... default font
color is white (aka invisible). However, if cell A19 is hidden (using
outline), then font color of A20 should be black.

I know how to do the conditional format ... but building the UDF is
throwing me off, as I've never built my own. I would image the final
output would be: =IsHidden(A19)

Can anyone help out with this?

TIA,
Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default UDF to evaluate if row is hidden?

Public Function IsHidden(r As Range) As Boolean
Application.Volatile
IsHidden = r.EntireRow.Hidden
End Function

--
Gary''s Student - gsnu2007d


"Ray" wrote:

hi -

I'd like to build a UDF to evaluate (true/false) whether a cell is in
a hidden row ... I'll then use this UDF in a conditional format
statement to change the font color of a cell.

As example, I'll have a string in A20 (eg October) ... default font
color is white (aka invisible). However, if cell A19 is hidden (using
outline), then font color of A20 should be black.

I know how to do the conditional format ... but building the UDF is
throwing me off, as I've never built my own. I would image the final
output would be: =IsHidden(A19)

Can anyone help out with this?

TIA,
Ray

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default UDF to evaluate if row is hidden?

Perfect, Gary ... UDF and conditional formatting worked exactly as I'd
hoped!

one question: what does 'Application.Volatile' mean? why is it
necessary?

thanks,
ray


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default UDF to evaluate if row is hidden?

The statement help to insure the function will be called. Sometimes Excel
thinks its really smart and avoids calling a function if it thinks the
argument has not changed.
--
Gary''s Student - gsnu2007d


"Ray" wrote:

Perfect, Gary ... UDF and conditional formatting worked exactly as I'd
hoped!

one question: what does 'Application.Volatile' mean? why is it
necessary?

thanks,
ray



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Copy and Paste with hidden columns remaining hidden Pendelfin Excel Discussion (Misc queries) 2 February 26th 09 11:35 AM
Rows hidden by Autofilter vs hidden by changing the Hidden property LEO@KCC Excel Programming 4 September 11th 07 10:14 AM
Hidden Columns No Longer Hidden after Copying Worksheet? EV Nelson Excel Discussion (Misc queries) 1 December 6th 06 05:10 PM
Saving hidden data with a worksheet (preferably without using a hidden sheet) Dick Kusleika[_3_] Excel Programming 2 January 21st 04 04:39 PM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"