Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Leo
 
Posts: n/a
Default Macro to hide/show rows and columns

I have a Excel worksheet using cells A1 to H430. There are quite a few empty
lines in this area, and when I print it out I don't want the empty lines. I
want to write a macro that will check column A (row headings), if one cell
has no content then the macro will hide the whole row.

Can someone please show me how this can be done in VBA code? Thanks a lot.


  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Macro to hide/show rows and columns

ASAP Utilities, a free Add-in available at www.asap-utilities.com has a
feature that will do this for you..........

Vaya con Dios,
Chuck, CABGx3




"Leo" wrote:

I have a Excel worksheet using cells A1 to H430. There are quite a few empty
lines in this area, and when I print it out I don't want the empty lines. I
want to write a macro that will check column A (row headings), if one cell
has no content then the macro will hide the whole row.

Can someone please show me how this can be done in VBA code? Thanks a lot.


  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Macro to hide/show rows and columns

Not exactly sure what you want to hide, but this may help

Dim oRow As Range
For Each oRow In Range("A1:H43").Rows
If Cells(oRow.Row, "F").Value = "" Then
oRow.EntireRow.Hidden = True
End If
Next oRow

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Leo" wrote in message
...
I have a Excel worksheet using cells A1 to H430. There are quite a few

empty
lines in this area, and when I print it out I don't want the empty lines.

I
want to write a macro that will check column A (row headings), if one cell
has no content then the macro will hide the whole row.

Can someone please show me how this can be done in VBA code? Thanks a

lot.




  #4   Report Post  
Posted to microsoft.public.excel.misc
Leo
 
Posts: n/a
Default Macro to hide/show rows and columns

Thanks a lot. I will try it out.

"CLR" wrote:

ASAP Utilities, a free Add-in available at www.asap-utilities.com has a
feature that will do this for you..........

Vaya con Dios,
Chuck, CABGx3




"Leo" wrote:

I have a Excel worksheet using cells A1 to H430. There are quite a few empty
lines in this area, and when I print it out I don't want the empty lines. I
want to write a macro that will check column A (row headings), if one cell
has no content then the macro will hide the whole row.

Can someone please show me how this can be done in VBA code? Thanks a lot.


  #5   Report Post  
Posted to microsoft.public.excel.misc
Leo
 
Posts: n/a
Default Macro to hide/show rows and columns

Thanks a lot Bob. This probably is the coding I am looking for. The rows I
want to hide are those who have no content in column A. i.e., if A10 has no
content, hide the entire 10th row.

I will try your code to see if it works. Thanks again.


"Bob Phillips" wrote:

Not exactly sure what you want to hide, but this may help

Dim oRow As Range
For Each oRow In Range("A1:H43").Rows
If Cells(oRow.Row, "F").Value = "" Then
oRow.EntireRow.Hidden = True
End If
Next oRow

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Leo" wrote in message
...
I have a Excel worksheet using cells A1 to H430. There are quite a few

empty
lines in this area, and when I print it out I don't want the empty lines.

I
want to write a macro that will check column A (row headings), if one cell
has no content then the macro will hide the whole row.

Can someone please show me how this can be done in VBA code? Thanks a

lot.





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
Rows & Columns in Excel seadragon69 Excel Worksheet Functions 2 December 7th 05 05:54 PM
convert columns to rows & rows to columns ROCKWARRIOR Excel Discussion (Misc queries) 2 September 23rd 05 06:31 PM
How to swap rows and columns? [email protected] Excel Discussion (Misc queries) 5 September 21st 05 08:07 AM
inserting columns within certain rows only crimsonkng Excel Discussion (Misc queries) 4 July 14th 05 05:13 PM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM


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