LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default Macro for hiding rows

Hi Jim,

It looks like all or most of the suggestions offered here
has been if cells are Blank. But, I see that you "prefer"
if rows are 0 (zero value).


Granted that there is potential ambiguity, my response was predicated on the
OP's statement:

I have a spreadsheet which contains a lot of rows with no data.


Which interpretation is correct can only be resolved by the OP, but at least
he now has solutions to deal with either eventuality.

---
Regards,
Norman



"JMay" wrote in message
news:oVSqf.84061$WH.53867@dukeread01...
Let's back up here.
If a cell has a 0 (zero) in it, it is not blank.


Before running this macro select (highlight) your intended range, say
G2:G1000 << Using Selection make the macro a bit more useful.

In a standard module put:

Sub HideRowsWithZero
For Each c In Selection
If c.Value = 0 Then
c.EntireRow.Hidden = True
End If
Next c
End Sub


Hope that Helps,








"KL" wrote in message
...
another way without macros:

1) select one of the columns where empty cells correspond to empty rows
2) menu EditGoto... 3) press the button 'Special...'
4) mark the 'Blanks' option and press 'OK'
5) menu FormatRowsHide...

or using short cut keys:

1) having the cursor in a cell of the relevant column press Ctrl+Space
2) Ctrl+g
3) Hold Alt+ s, k, 4) Enter
5) Hold Alt + o, r, h

Regards,
KL


"Luke" wrote in message
...
I have a spreadsheet which contains a lot of rows with no data, I would
like to create a macro to hide these rows.

Preferably I would like it to work off one column and hide any rows with
a value of zero.

Any ideas?





 
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
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Macro - to copy duplicate rows to another sheet [email protected] Excel Worksheet Functions 2 April 19th 05 01:53 AM
inset rows and copy formatting , excel macro sloanranger Excel Discussion (Misc queries) 13 March 9th 05 11:44 PM
MACRO - copy rows based on value in column to another sheet Michael A Excel Discussion (Misc queries) 1 March 5th 05 02:15 AM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM


All times are GMT +1. The time now is 11:56 AM.

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"