ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hide Blank Rows (https://www.excelbanter.com/excel-worksheet-functions/230007-hide-blank-rows.html)

TamIam

Hide Blank Rows
 
I don't know how to use macros, (I'm assuming I would need one), but does
anyone know of one I could copy/paste into my spreadsheet that will hide
blank rows within a specific range?
--
Thanks for your help!

Jacob Skaria

Hide Blank Rows
 
Set the Security level to low/medium in (Tools|Macro|Security). 'Launch VBE
using short-key Alt+F11. Insert a module and paste the below code. Save. Get
back to Workbook. Tools|Macro|Run the macro()

Change the range as required

Sub RemoveBlankRows()
Dim varRange As Range
Dim lngRow As Long
Set varRange = Range("A1:Z10")

For lngRow = varRange.Rows.Count To varRange.Row Step -1
If WorksheetFunction.CountBlank(Rows(lngRow)) = Columns.Count Then
Rows(lngRow).Delete
End If
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"TamIam" wrote:

I don't know how to use macros, (I'm assuming I would need one), but does
anyone know of one I could copy/paste into my spreadsheet that will hide
blank rows within a specific range?
--
Thanks for your help!


Dennis Tucker

Hide Blank Rows
 
To do this manually, select the entire rows you want to hide by clicking on
the row IDs(1,2,3...) while holding the Ctrl key. Then when all selection
is complete, right click on one of the selected row IDs and choose Hide.

To make a macro to do the same thing, access the macro recorder and start a
macro recording then repeat the same thing from above. Then turn of the
recorder. You can then view, edit, run or delete the macro you recorded.


Dennis

"TamIam" wrote in message
...
I don't know how to use macros, (I'm assuming I would need one), but does
anyone know of one I could copy/paste into my spreadsheet that will hide
blank rows within a specific range?
--
Thanks for your help!



Gord Dibben

Hide Blank Rows
 
You don't need a macro.

Select a column within the range and F5SpecialBlanksOK

FormatRowHide.


Gord Dibben MS Excel MVP

On Wed, 6 May 2009 08:43:00 -0700, TamIam
wrote:

I don't know how to use macros, (I'm assuming I would need one), but does
anyone know of one I could copy/paste into my spreadsheet that will hide
blank rows within a specific range?




All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com