Below Is A Routine I Created To Hide Rows In Groups Of 6 when Column C Is Clear Starting @ Row 18 And Checking Every 6th Row From That Point On Until The End, Indicated By The Variable 'Last_Manifest_Store_Row'. After The Worksheet Is Reduced To Show The Group Of 6 Rows With The Data I Need, The Rest Of The Routine Is Suppose To Move Automatic Page Breaks To The Rows Necessary To Print The Worksheet With A Header Of The First 15 Rows And 9 Groups Of 6 Rows Or 52 Visible Rows For Every Page To Be Printed. My Problem Is In The Moving Of The Page Break, I Get An Run-time Error '438': Object Doesn't Not Support This Property Or Method. I've Included A Copy Of The Worksheet With The Macro In the Attachment, You Can See What Happens When You Run The Macro Yourself. Can Someone Help???
Sub Consoildate_Manifest()
'
Call Expand_Manifest
ActiveSheet.ResetAllPageBreaks
ActiveSheet.PageSetup.Zoom = 73
Page_Breaks = 1
Number_Of_Stores = 0
For I = 16 To Last_Manifest_Store_Row Step 6
If Cells(I + 2, 3) = "" Then
J = I
Do
J = J + 6
Loop Until Cells(J + 2, 3) <> "" Or J = Ending_Manifest_Row
Range(Cells(I, 2), Cells(J - 1, 5)).Select
Selection.EntireRow.Hidden = True
I = J
Number_Of_Stores = Number_Of_Stores + 1
If Number_Of_Stores = 10 Then
New_Page_Breaks(Page_Breaks) = J
Cells(Page_Breaks, 7) = J
Cells(1, 8) = Page_Breaks
Page_Breaks = Page_Breaks + 1
Number_Of_Stores = 1
End If
End If
Next I
ActiveWindow.View = xlPageBreakPreview
Application.ScreenUpdating = False
For J = 1 To Page_Breaks - 1
Set ActiveSheet.HPageBreak(J).Location = Range("A" & New_Page_Breaks(J))
Next J
Application.ScreenUpdating = True
ActiveWindow.View = xlNormalView
Range(Cells(1, 2), Cells(1, 2)).Select
'
End Sub
Bookmarks