...

View Full Version : Page break macro



bennystromberg
03-16-2004, 07:40 AM
I would like to code a macro that makes a page break every time the character - is used in column A in an excel worksheet. How can I do this?

Thanks for your help!

raf
03-16-2004, 03:48 PM
Something like (VB, not PHP)


Sub dash2break()
Cells.Find(What:="-", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
ActiveWindow.SelectedSheets.VPageBreaks.Add Before:=ActiveCell
End Sub



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum