M
Murray
Hide i have a piece of code thanks to some newsgroup
people that i have changed a little to suit my purpose.
Basically i want it to look at ColumnB between rows 32 and
79 inclusive and if it fines blank cells in columnB hide
the entire row. This is what i have and it gives me a
compile error Loop without Do. I don't know if the rest
will run because i can't get past the error.
Your help is appreciated
Murray
Sub ActivateNextBlankDown()
ApplicationScreenUpdating = False
ActiveCell.Offset(32, 2).Select
Do While IsEmpty(ActiveCell)
If IsEmpty(ActiveCell) Then
Selection.EntireRow.Hidden = True
Loop
ApplicationScreenUpdating = True
End If
Application.ActivePrinter = "\\SERVER2\Energy3 on Ne10:"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.65)
.RightMargin = Application.InchesToPoints(0.55)
.TopMargin = Application.InchesToPoints(0.58)
.BottomMargin = Application.InchesToPoints(0.57)
.HeaderMargin = Application.InchesToPoints(0.36)
.FooterMargin = Application.InchesToPoints(0.21)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA3
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 75
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintPreview
End Sub
people that i have changed a little to suit my purpose.
Basically i want it to look at ColumnB between rows 32 and
79 inclusive and if it fines blank cells in columnB hide
the entire row. This is what i have and it gives me a
compile error Loop without Do. I don't know if the rest
will run because i can't get past the error.
Your help is appreciated
Murray
Sub ActivateNextBlankDown()
ApplicationScreenUpdating = False
ActiveCell.Offset(32, 2).Select
Do While IsEmpty(ActiveCell)
If IsEmpty(ActiveCell) Then
Selection.EntireRow.Hidden = True
Loop
ApplicationScreenUpdating = True
End If
Application.ActivePrinter = "\\SERVER2\Energy3 on Ne10:"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.65)
.RightMargin = Application.InchesToPoints(0.55)
.TopMargin = Application.InchesToPoints(0.58)
.BottomMargin = Application.InchesToPoints(0.57)
.HeaderMargin = Application.InchesToPoints(0.36)
.FooterMargin = Application.InchesToPoints(0.21)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA3
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 75
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintPreview
End Sub