Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Macro to HIDE blank rows

I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Macro to HIDE blank rows

Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(1)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default Macro to HIDE blank rows

Sub row_hide()

Dim rng As Integer, i As Integer

rng = Cells(Rows.Count, "A").End(xlUp).Row

For i = 1 To rng
Cells(i, "A").Select
x = Application.WorksheetFunction.Count(ActiveCell.Ent ireRow)
If x = 0 Then ActiveCell.EntireRow.Hidden = True
Next i
End Sub


On Jun 5, 6:08*pm, JForsyth
wrote:
I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Macro to HIDE blank rows

Thanks for writing back! Unfortunately it's not working...when I run it, the
rows don't become hidden...any suggestions?

"Jacob Skaria" wrote:

Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(1)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Macro to HIDE blank rows

Oops. That was my mistake.Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(lngRow)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

Thanks for writing back! Unfortunately it's not working...when I run it, the
rows don't become hidden...any suggestions?

"Jacob Skaria" wrote:

Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(1)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Macro to HIDE blank rows

Thank You!!!! It works perfectly!

"Jacob Skaria" wrote:

Oops. That was my mistake.Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(lngRow)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

Thanks for writing back! Unfortunately it's not working...when I run it, the
rows don't become hidden...any suggestions?

"Jacob Skaria" wrote:

Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(1)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Macro to HIDE blank rows

Thank you!!! This works perfectly!!!

"Jacob Skaria" wrote:

Oops. That was my mistake.Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(lngRow)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

Thanks for writing back! Unfortunately it's not working...when I run it, the
rows don't become hidden...any suggestions?

"Jacob Skaria" wrote:

Try the below

Sub Hideemptyrows()
For lngRow = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountBlank(Rows(1)) = Columns.Count _
Then Rows(lngRow).Hidden = True
Next
End Sub

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


"JForsyth" wrote:

I have seen a couple of threads on how to create a macro to DELETE blank rows
but this is not what I'm looking for. I need to be able to simply HIDE the
blank rows. Does anyone know how to do this?

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
Hide Blank Rows TamIam Excel Worksheet Functions 3 May 6th 09 08:42 PM
VBA code to hide blank rows ub Excel Worksheet Functions 4 July 31st 08 01:44 PM
Hide Blank Rows dee Excel Worksheet Functions 2 May 17th 06 11:30 PM
macro to hide rows if cell is blank Shooter Excel Worksheet Functions 3 September 28th 05 10:55 PM
remove or hide blank rows Erik Beijlen via OfficeKB.com Excel Discussion (Misc queries) 1 February 1st 05 01:17 PM


All times are GMT +1. The time now is 08:18 AM.

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"