Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to pagebreak

Hello everyone,

My problem is that I need to automate insertion of pagebreak in an excel
document.

I pull data from database and spit it out on an excel sheet and then I want
to write a short VB application or just a macro which insert page breaks at
a particular places which i will mark on excel sheet while spitting out
data.

so this macro/routine should just look through an entire coulmn in excel
sheet and when it found the mark it will just insert the page break
automatically and replace the mark by null.

I dont have enough experience in writing VBA routines. I would be very
thankful if someone can guide me.

Thanks a lot,

Bilal



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to pagebreak

Turn on the macro recorder and insert a pagebreak. Turn it off.

That will give you the syntax for inserting a pagebreak. You can loop
through your cells looking for your mark

Dim cell as Range
for each cell in Range(Range("A1"),Cells(rows.count,1).End(xlup))
if cell.Value = "Mark" then
' code to insert pagebreak
end if
Next

--
Regards,
Tom Ogilvy

"Bilal A F" wrote in message
...
Hello everyone,

My problem is that I need to automate insertion of pagebreak in an excel
document.

I pull data from database and spit it out on an excel sheet and then I

want
to write a short VB application or just a macro which insert page breaks

at
a particular places which i will mark on excel sheet while spitting out
data.

so this macro/routine should just look through an entire coulmn in excel
sheet and when it found the mark it will just insert the page break
automatically and replace the mark by null.

I dont have enough experience in writing VBA routines. I would be very
thankful if someone can guide me.

Thanks a lot,

Bilal





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help coding a PageBreak Marty Excel Discussion (Misc queries) 3 December 7th 07 01:33 PM
Cant move pagebreak in PageBreak View in Excel2003 Vasanthan Excel Worksheet Functions 1 August 22nd 07 03:28 PM
Rogue vertical pagebreak GSS[_2_] Excel Programming 2 November 10th 03 05:29 PM
PAGEBREAK-MACRO Jay Dean Excel Programming 2 September 19th 03 12:40 PM
how to set excel pagebreak in programm chengquan Excel Programming 0 August 12th 03 10:02 AM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"