Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Macro to hide rows containing no data

My spreadsheet is A1:Q308. I would like only the rows
which contain a value in the Q column that is less than
zero or greater than zero to be printed. There are also
some blank rows which contain no data or formulas in the
A1:Q308 worksheet. I would like the macro to search the
sheet, suppress the rows that do not qualify for display,
and let me print what remains.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Macro to hide rows containing no data

I think I wouldn't use a macro.

I'd select the range and do Data|Filter|autofilter.

You can use the dropdown on each header cell and show or hide the values you
want.

There's even an option for Custom.

"Does not equal" 0
And
"does not equal" (leave blank)

may be useful.

John wrote:

My spreadsheet is A1:Q308. I would like only the rows
which contain a value in the Q column that is less than
zero or greater than zero to be printed. There are also
some blank rows which contain no data or formulas in the
A1:Q308 worksheet. I would like the macro to search the
sheet, suppress the rows that do not qualify for display,
and let me print what remains.


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Macro to hide rows containing no data

HAve you thought of just using Auto Filter?

"John" wrote in message
...
My spreadsheet is A1:Q308. I would like only the rows
which contain a value in the Q column that is less than
zero or greater than zero to be printed. There are also
some blank rows which contain no data or formulas in the
A1:Q308 worksheet. I would like the macro to search the
sheet, suppress the rows that do not qualify for display,
and let me print what remains.



  #4   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default Macro to hide rows containing no data


"Paul Lautman" wrote in message
...
HAve you thought of just using Auto Filter?

"John" wrote in message
...
My spreadsheet is A1:Q308. I would like only the rows
which contain a value in the Q column that is less than
zero or greater than zero to be printed. There are also
some blank rows which contain no data or formulas in the
A1:Q308 worksheet. I would like the macro to search the
sheet, suppress the rows that do not qualify for display,
and let me print what remains.




tHIS SEEMS TO WORK

Sub ENTIREROWS()

Dim X As Range


Dim FLAG As Integer
Range("A1").Select
For Each Row In ActiveSheet.UsedRange
For Each CELL In Row
CELL.Select
If CELL.Value "" Then FLAG = 1
Next
If FLAG < 1 Then ActiveCell.Select
If FLAG < 1 Then Selection.EntireRow.Delete
FLAG = 0
Next
End Sub

N10


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
Macro to hide rows lightbulb Excel Discussion (Misc queries) 4 July 11th 08 06:13 PM
hide rows with macro Macro to hide rows in spreadwsheet Excel Discussion (Misc queries) 3 May 12th 05 05:02 PM
macro to hide rows david Excel Discussion (Misc queries) 3 April 8th 05 03:25 PM
Macro to hide rows. Steve Excel Programming 4 January 25th 04 08:46 PM


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