![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Is there a way to make a page break based on the change in a particular column?
I have a list of sales info that changes each time I refresh it and I need the worksheet to set the page breaks automatically for each salesman. Salesman# is one of the columns and the data is sorted on that column. Thanks! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Guderup, Denmark
Posts: 287
|
Hi
you could download ASAP utilities http://www.asap-utilities.com/ When installed try ASAP / Formats / the smart difference. (build for this job) regards Tommy |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Guderup, Denmark
Posts: 287
|
You could also try this macro. Set c to the columnno for #salesman.
Sub Pages() c = 1 '** insert the columnno you want to use for pagebreaks ** x = Application.WorksheetFunction.CountA(Columns(c)) For i = 2 To x If Cells(i, c) <> Cells(i - 1, c) Then ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(i, 1) End If Next End Sub regards Tommy |
|
|
|
|
|
#4 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
I couldn't get either one to work. On the 2nd option, I replaced the 1 with the column # of the salesmen# (13 for coumn "M")
I ran the macro and it did nothing. I don't know? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|