Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Raj Raj is offline
external usenet poster
 
Posts: 130
Default VB Code to hide and unhide rows

Dear All

I need a VB code for the following.

When I select a range in an excel sheet. The hidden rows in that range
should get unhidden and then based on a condition the rows must be hidden
within the selected range.

For example I select A1 to D5. Whatever hidden rows are there between Row 1
and Row 5 should get hidden. Then if it is observed that between A1:D1 all
the cells are blank, then the code hides row 1 and so on.

I need the same very urgently as my work is pending just because of this code.

Thanks a lot in Advance
Raj

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default VB Code to hide and unhide rows

Raj,

Dim myC As Range
Selection.EntireRow.Hidden = False
For Each myC In Selection.Rows
If Application.WorksheetFunction.CountBlank(myC) = _
Selection.Columns.Count Then
myC.EntireRow.Hidden = True
End If
Next myC

HTH,
Bernie
MS Excel MVP


"Raj" wrote in message
...
Dear All

I need a VB code for the following.

When I select a range in an excel sheet. The hidden rows in that range
should get unhidden and then based on a condition the rows must be hidden
within the selected range.

For example I select A1 to D5. Whatever hidden rows are there between Row 1
and Row 5 should get hidden. Then if it is observed that between A1:D1 all
the cells are blank, then the code hides row 1 and so on.

I need the same very urgently as my work is pending just because of this code.

Thanks a lot in Advance
Raj



  #3   Report Post  
Posted to microsoft.public.excel.misc
Raj Raj is offline
external usenet poster
 
Posts: 130
Default VB Code to hide and unhide rows

Thanks a lot

It works wonders

Regards
Raj

"Bernie Deitrick" wrote:

Raj,

Dim myC As Range
Selection.EntireRow.Hidden = False
For Each myC In Selection.Rows
If Application.WorksheetFunction.CountBlank(myC) = _
Selection.Columns.Count Then
myC.EntireRow.Hidden = True
End If
Next myC

HTH,
Bernie
MS Excel MVP


"Raj" wrote in message
...
Dear All

I need a VB code for the following.

When I select a range in an excel sheet. The hidden rows in that range
should get unhidden and then based on a condition the rows must be hidden
within the selected range.

For example I select A1 to D5. Whatever hidden rows are there between Row 1
and Row 5 should get hidden. Then if it is observed that between A1:D1 all
the cells are blank, then the code hides row 1 and so on.

I need the same very urgently as my work is pending just because of this code.

Thanks a lot in Advance
Raj




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
hide or unhide rows with button Bea Excel Discussion (Misc queries) 15 September 19th 07 07:03 PM
Code for button to hide/unhide rows Chris Excel Worksheet Functions 5 March 5th 07 06:15 AM
Macro that will unhide then hide rows minka Excel Discussion (Misc queries) 10 October 21st 06 01:37 PM
Hide Unhide Rows blackstar Excel Discussion (Misc queries) 2 February 6th 06 09:36 PM
Checkbox to hide and unhide rows Please. Steved Excel Worksheet Functions 2 December 6th 04 11:30 PM


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