Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
manda
 
Posts: n/a
Default Conditional Formatting Shading For Visible Rows Only

I am using conditional formatting formula =MOD(Row(),2)=0 to shade
alternate rows, but when I hide a row the shading format is not
consistent. Is there way to shade alternate 'Visible Only' rows without
creating a macro?

  #2   Report Post  
Posted to microsoft.public.excel.misc
tony h
 
Posts: n/a
Default Conditional Formatting Shading For Visible Rows Only


you can do it using a user-defined-function. The UDF is then used on the
worksheet.
Would that class as a macro for this purpose?

regards


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=543113

  #3   Report Post  
Posted to microsoft.public.excel.misc
manda
 
Posts: n/a
Default Conditional Formatting Shading For Visible Rows Only

The UDF seems a little too complex for me. Is there maybe some kind of
'Visible' code that I could use for the conditional formatting formula?

  #4   Report Post  
Posted to microsoft.public.excel.misc
tony h
 
Posts: n/a
Default Conditional Formatting Shading For Visible Rows Only


this function returns a true or false depending on the number of visible
rows

Function visLines(ByRef rng As Range) As Boolean
Application.Volatile
Dim rng1 As Range
Dim rng2 As Range
Dim bln As Boolean

Set rng1 = rng.Resize(rng.Row).Offset(1 - 1 * rng.Row)

For Each rng2 In rng1
If rng2.Height < 0 Then
bln = Not bln
End If
Next
Debug.Print rng1.Address, l, bln
visLines = bln
End Function


then use conditional formatting using the cell reference so if in cell
D5 use vilines(D5)

cheers


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=543113

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
Conditional Formatting sweetsue516 Excel Discussion (Misc queries) 7 September 20th 05 08:16 PM
Conditional Formatting Error ddate Excel Worksheet Functions 0 May 5th 05 09:00 PM
Copy conditional formatting across multiple rows? Gil Excel Discussion (Misc queries) 1 January 11th 05 11:27 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
CAN I HIDE ROWS WITH CONDITIONAL FORMATTING? Likepike Excel Discussion (Misc queries) 2 December 21st 04 04:02 PM


All times are GMT +1. The time now is 11:06 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"