Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default VB Code to hide rows

I want a macro that hides a dyamic named range. For example:
A
1 unhide
2 unhide
3 unhide
4 hide
5 hide
6 hide
7 unhide

The hide/unhide are based on the contents of what is in column B, therefore
the rows that indicate hide won't be static. However the cells indicating
hide will always be next to each other (no overlap)... I was thinking that I
need to define a named range which would include the rows that indicate hide
in column A and then hide that named range. (ie in this case my named range
would consist of rows 4-6, but again it wont always be this way.) I have
numerous lines of data and do NOT want the macro to have to read through 4000
cells... I figured this would be much quicker! Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default VB Code to hide rows

Hi, what if you had the cells that you want to hide contain a blank
value (""). The solution could be pretty simple:

Sub uHide()
Cells.Rows.Hidden = False
Columns(1).EntireColumn.SpecialCells(xlBlanks).Row s.Hidden
End Sub


HTH--Lonnie M.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default VB Code to hide rows

Correction:
* Columns(1).EntireColumn.SpecialCells(xlBlanks).Row s.Hidden


Should read:
Columns(1).EntireColumn.SpecialCells(xlBlanks).Row s.Hidden = True
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
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Code for Excel 2007 to hide rows based on sum of several rows not ina range Joe Gardill Excel Programming 2 August 29th 08 03:53 PM
Code to Hide Rows BHatMJ Excel Programming 3 May 24th 07 04:21 PM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM


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