Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-20-2012, 06:13 AM
Catalin.B Catalin.B is offline Is there a way to print based on a particular filter? Windows Vista Is there a way to print based on a particular filter? Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, România
Posts: 386
Catalin.B is on a distinguished road
Default

You can place a page break when the cell value in column 1 changes.
Code:
Option Explicit
Sub MakePageBreaks()
Dim i As Integer
ActiveSheet.ResetAllPageBreaks
Application.ScreenUpdating = False

For i = 2 To 800
If ActiveSheet.Cells(i, 1).Text <> ActiveSheet.Cells(i + 1, 1).Text Then
ActiveSheet.Cells(i + 1, 1).Select
ActiveWindow.SelectedSheets.HPageBreaks.Add before:=ActiveCell
End If
Next
Application.ScreenUpdating = True
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apply filter with VBA bobsawyer7 Outlook 0 03-12-2012 04:02 AM
Is there a way to print based on a particular filter? Mail Merge to print specific record based on mergefield criterias nicnad Mail Merge 1 02-22-2012 01:53 AM
Modify vba code to print based on name in the InputBox OTPM Project 0 05-25-2011 02:03 AM
Is there a way to print based on a particular filter? filter kwlickt Excel 1 03-28-2011 11:15 AM
Is there a way to print based on a particular filter? could you help me help me with advanced filter Nora Excel 1 05-15-2009 11:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft