Hi
I need a macro to insert a page break before each empty cell in column k. The print range is from a14 down. There are empty rows after each change in data which will have a page break.
Thanks
Hi
I need a macro to insert a page break before each empty cell in column k. The print range is from a14 down. There are empty rows after each change in data which will have a page break.
Thanks
How about something like this ?
Please click the * below if this helps![]()
Sub Test() Dim cell As Range For Each cell In Range("K14:K" & Range("K65536").End(xlUp).Row) If cell.Value = "" Then HPageBreaks.Add Before:=cell Next cell End Sub
![]()
Please click the * below if this helps
I get a error on this line
HPageBreaks.Add Before:=cell
Hi, jdvdh001,
imaybe it should read ActiveSheet.HPageBreaks.Add Before:=cell.
Ciao,![]()
Sub Test_2() Dim cell As Range On Error Resume Next For Each cell In Range("K14:K" & Range("K65536").End(xlUp).Row).SpecialCells(xlCellTypeBlanks) ActiveSheet.HPageBreaks.Add Before:=cell Next cell End Sub
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks