Hide blank rows on each page excel

magpie2000k

Board Regular
Joined
Sep 13, 2013
Messages
196
Ye I mean Blank not Black

Hi I have used the below VB code and i can get it to work to hide blank rows on sheet 1 where the contents in A is blank

However I need to get it to run for all pages in the workbook. of which there are 4

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160913
Dim xRg As Range
Application.ScreenUpdating = False
For Each xRg In Range("A1:A70")
If xRg.Value = "" Then
xRg.EntireRow.Hidden = True

Else
xRg.EntireRow.Hidden = False
End If
Next xRg
Application.ScreenUpdating = True
End Sub

Any help would be great..
 
Last edited:
Re: Help to hide black rows on each page excel

Sorry for the delayed response no I do not get any error messages It will run on the tab i am on on each tab but I have to run it on each and every tab individually and doing so takes it off the previous tab if that makes sense

Thanks
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Re: Help to hide black rows on each page excel

That sounds as though you have some other code that is affecting things. Check to see if you have any event code especially sheet activate, or deactivate events.
 
Upvote 0
Re: Help to hide black rows on each page excel

I cant see anything other than the one macro is there a way to check ..

I am brand new to VBA
 
Upvote 0
Re: Help to hide black rows on each page excel

In the VB Editor look in each sheet module & also in the ThisWorkbook module
 
Upvote 0
Re: Help to hide black rows on each page excel

Would you be willing to share a (sanitised copy) of your workbook?
 
Upvote 0
Re: Help to hide black rows on each page excel

Upload to OneDrive, or Dropbox, mark it as shared & paste the link to this thread.
 
Upvote 0

Forum statistics

Threads
1,215,452
Messages
6,124,916
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top