Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2004, 06:40 AM   PM User | #1
bennystromberg
New Coder

 
Join Date: Dec 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
bennystromberg is an unknown quantity at this point
Page break macro

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!
bennystromberg is offline   Reply With Quote
Old 03-16-2004, 02:48 PM   PM User | #2
raf
Master Coder


 
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
raf will become famous soon enoughraf will become famous soon enough
Something like (VB, not PHP)
PHP Code:
Sub dash2break()
    
Cells.Find(What:="-"After:=ActiveCellLookIn:=xlFormulasLookAt:= _
        xlPart
SearchOrder:=xlByRowsSearchDirection:=xlNextMatchCase:=False_
        
.Activate
    ActiveWindow
.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
    ActiveWindow
.SelectedSheets.VPageBreaks.Add Before:=ActiveCell
End Sub 
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html
raf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:22 AM.


Advertisement
Log in to turn off these ads.