Results 1 to 4 of 4

macro to insert page break when value in row changes

Threaded View

printroom macro to insert page break... 03-19-2013, 05:29 AM
patel45 Re: macro to insert page... 03-19-2013, 06:05 AM
printroom Re: macro to insert page... 03-19-2013, 06:08 AM
visha_1984 Re: macro to insert page... 03-19-2013, 06:15 AM
  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    Yorkshire England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Exclamation macro to insert page break when value in row changes

    Hi I need a macro that will insert a page break when the value in column A changes I have a list of around 95 numbers with approx 78 rows of data for each number though this will vary, there is a macro in there that used to work but longer does this macro was

    Sub PageBreak()
    Dim RNG As Range
    Dim CurrNM As String

    CurrNM = Range("A1").Value
    For Each RNG In Range("A1", Range("A65536").End(xlUp))
    If Not (CurrNM = RNG.Value Or RNG = "") Then
    CurrNM = RNG.Value
    ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=RNG
    End If
    Next RNG
    End Sub

    any help would be greatly appreciated this is a report I have to run daily and is currently taking a ream of paper a day
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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