Conditional Formatting Question inside... :)

BEEK

New Member
Joined
Mar 13, 2002
Messages
2
Hello. Excel '97 here...

What I have is a three-column sheet where the second column is filled with one of around 10 names.

I need to know how to insert a page break (automatically) when the name in the second column changes (for example...if the first three rows have Jones as the name in the second column and then the next row has Smith, I need for it to insert a page break because the name changed).

I understand how to insert a page break by hand but I'm trying to automate this process.

Thanks in advance for any assistance anyone might can offer!

BEEK

"Everyone will have eternal life...where will you spend yours?"
This message was edited by BEEK on 2002-03-14 11:47
This message was edited by BEEK on 2002-03-14 11:49
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try using the following code where a1 is the location of the first name:
Range("a1").Select
For i = 1 To 10
If Not ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
ActiveWindow.SelectedSheets.HPageBreaks.Add before:=ActiveCell.Offset(1, 0)
End If
ActiveCell.Offset(1, 0).Select
Next i
End Sub

I hope this helps.
Kind regards, Al.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,953
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top