• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

macros help please

Izhar

Member
hi,

i have a file that needs to have a page break after the words "
Carried to Collection"

i am having troble with the macro i record to move down and do the page break for every "
Carried to Collection
" cell in the work sheet how do programme the marco to look downwards

please find attached the file with the macro
 

Attachments

  • MM External LinkMARC.xlsx
    256.5 KB · Views: 8
Check this.

Code:
Sub PageB()
Dim Rng As Range, cell As Range
Set Rng = Range(Cells(1, 3), Cells(Rows.Count, 3).End(xlUp))
For Each cell In Rng
    If cell.Value = "Carried to Collection" Then _
        ActiveSheet.HPageBreaks.Add Before:=cell.Offset(1, 0)
Next
End Sub
 
Back
Top