Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default code for hiding rows-(coloured)

Hell friends,

I want to know whether it is possible to create a code which by invoking it
to run should hide the rows which are highlighted by a particular colour.
If so any one will help me by providing it.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default code for hiding rows-(coloured)

Try this

Sub Test()
Dim rw As Range

For Each rw In ActiveSheet.UsedRange.Rows
If rw.Interior.ColorIndex = 34 Then
rw.Hidden = True
End If
Next rw

End Sub



--
HTH

Bob Phillips

"srinivasan" wrote in message
...
Hell friends,

I want to know whether it is possible to create a code which by invoking

it
to run should hide the rows which are highlighted by a particular

colour.
If so any one will help me by providing it.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default code for hiding rows-(coloured)


Mr Bob,
Thanks a lot. But as I am not familiar to VBA how it will work? Any colour
to the cell background or font colour.If I change the colour is the code has
to be changed

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default code for hiding rows-(coloured)

We are talking cell colour here, testing the Colorindex.

Do you want to check both cell colour and font colour? If so, what colours?

--
HTH

Bob Phillips

"srinivasan" wrote in message
...

Mr Bob,
Thanks a lot. But as I am not familiar to VBA how it will work? Any colour
to the cell background or font colour.If I change the colour is the code

has
to be changed



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default code for hiding rows-(coloured)



Hello,

I want to use the cell colour with pale blue(not font colour). Expecting
your kind response.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default code for hiding rows-(coloured)

Sub Test()
Dim rw As Range

For Each rw In ActiveSheet.UsedRange.Rows
If rw.Interior.ColorIndex = 37 Then 'Pale blue
rw.Hidden = True
End If
Next rw

End Sub

Go to the VB IDE (alt-F11), insert a code module (InsertModule), and paste
the code in.

Then in excel ToolsMacroMacros... and select Test and Run.

--
HTH

Bob Phillips

"srinivasan" wrote in message
...


Hello,

I want to use the cell colour with pale blue(not font colour). Expecting
your kind response.



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
Coloured rows Tim New Users to Excel 9 November 28th 06 02:11 AM
How to code Macro for hiding rows Catherine Bond Excel Worksheet Functions 4 June 24th 06 10:13 AM
Coloured rows sonic-the-mouse New Users to Excel 1 May 29th 05 06:21 PM
Coloured rows sonic-the-mouse New Users to Excel 2 May 29th 05 01:16 AM
Is it possible to have a code that counts coloured cells? Fiona Excel Programming 4 February 14th 05 01:41 PM


All times are GMT +1. The time now is 01:00 PM.

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

About Us

"It's about Microsoft Excel"