Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2012, 02:13 PM
Jamal NUMAN Jamal NUMAN is offline Is there a way to print based on a particular filter? Windows 7 64bit Is there a way to print based on a particular filter? Office 2010 64bit
Expert
Is there a way to print based on a particular filter?
 
Join Date: Nov 2010
Posts: 525
Jamal NUMAN is on a distinguished road
Question Is there a way to print based on a particular filter?

Is there a way to print based on a particular filter?



I wanted to print in separate pages based on a particular filtered value. For example, in the attached file, I need to print according to the name of the governorate such that the “Bethlehem” governorate is never printed in the same page with next governorate, which is “Hebron” in this case.

I’m used to do this sort of work manually (by making empty rows) but wondering if there is an automated way that helps doing so. please, have a look on the attached screenshots.



the data file is attached.


Thank you for the help,

Best

Jamal
Attached Images
File Type: jpg Clip_562.jpg (99.0 KB, 11 views)
File Type: jpg Clip_563.jpg (133.2 KB, 11 views)
Attached Files
File Type: xlsx check_local Autorities.xlsx (35.9 KB, 13 views)
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank.
Reply With Quote
  #2  
Old 03-15-2012, 09:37 PM
gsrikanth gsrikanth is offline Is there a way to print based on a particular filter? Windows XP Is there a way to print based on a particular filter? Office XP
Competent Performer
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

Quote:
Originally Posted by Jamal NUMAN View Post
Is there a way to print based on a particular filter?

I wanted to print in separate pages based on a particular filtered value. For example, in the attached file, I need to print according to the name of the governorate such that the “Bethlehem” governorate is never printed in the same page with next governorate, which is “Hebron” in this case.

I’m used to do this sort of work manually (by making empty rows) but wondering if there is an automated way that helps doing so. please, have a look on the attached screenshots.



the data file is attached.


Thank you for the help,

Best

Jamal
use this select first column named list in b2 kept this formula =INDEX(List,MATCH(0,COUNTIF($b$1:b1,List),0)) with ctrl+shift+enter
Reply With Quote
  #3  
Old 03-16-2012, 01:57 AM
Jamal NUMAN Jamal NUMAN is offline Is there a way to print based on a particular filter? Windows 7 64bit Is there a way to print based on a particular filter? Office 2010 64bit
Expert
Is there a way to print based on a particular filter?
 
Join Date: Nov 2010
Posts: 525
Jamal NUMAN is on a distinguished road
Question

Quote:
Originally Posted by gsrikanth View Post
use this select first column named list in b2 kept this formula =INDEX(List,MATCH(0,COUNTIF($b$1:b1,List),0)) with ctrl+shift+enter

thank you for the answer gsrikanth.

i tried what you have already advised but sounds not to work with me. I'm not sure if your time permits to stick the equation on my actual excel sheet (which is provided in my previous post) so that i can proceed.

all the best

Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank.
Reply With Quote
  #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
  #5  
Old 03-20-2012, 11:32 AM
Jamal NUMAN Jamal NUMAN is offline Is there a way to print based on a particular filter? Windows 7 64bit Is there a way to print based on a particular filter? Office 2010 64bit
Expert
Is there a way to print based on a particular filter?
 
Join Date: Nov 2010
Posts: 525
Jamal NUMAN is on a distinguished road
Thumbs up

Quote:
Originally Posted by Catalin.B View Post
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
Perfect… this is what I’m looking for exactly. Many thanks Catalin.B. your time and efforts are highly appreciated.
Best
Jamal
Attached Images
File Type: jpg Clip_620.jpg (138.5 KB, 12 views)
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank.
Reply With Quote
Reply



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:22 AM.


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