+ Reply to Thread
Results 1 to 3 of 3

Moving Automatic Page Breaks

Hybrid View

  1. #1
    Registered User
    Join Date
    02-02-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Moving Automatic Page Breaks

    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
    Attached Files Attached Files
    Last edited by VBA Noob; 02-03-2009 at 03:08 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving Automatic Page Breaks

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Moving Automatic Page Breaks

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1