+ Reply to Thread
Results 1 to 4 of 4

excel VBA insert pagebreak after shape

  1. #1
    Registered User
    Join Date
    11-06-2011
    Location
    Surrey
    MS-Off Ver
    Excel 2010
    Posts
    51

    excel VBA insert pagebreak after shape

    Guys

    I use the following to draw 10 rectangles

    For a = 1 To 10

    Sheet1.Shapes.AddTextbox(msoTextOrientationHorizontal, 350, B, 300, 200).TextFrame.Characters.Text = Worksheets("Sheet2").Range("A" & a).Value & vbNewLine & Worksheets("Sheet2").Range("B" & a).Value & vbNewLine & Worksheets("Sheet2").Range("C" & a).Value & vbNewLine & Worksheets("Sheet2").Range("D" & a).Value & vbNewLine & Worksheets("Sheet2").Range("E" & a).Value & vbNewLine & Worksheets("Sheet2").Range("F" & a).Value & vbNewLine & Worksheets("Sheet2").Range("G" & a).Value & vbNewLine & Worksheets("Sheet2").Range("H" & a).Value
    ActiveSheet.Shapes.AddShape _
    (msoShapeFlowchartProcess, 65, B, 300, 200).Select
    Selection.ShapeRange.Fill.ForeColor.SchemeColor = 11
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.Visible = msoTrue
    B = B + 230

    Next a

    is there a way of inserting a page break after 4 rectangles are drawn?


    Any Help Appreciated

    Mark

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: excel VBA insert pagebreak after shape

    Please edit your post... highlight the code and hit the "#" icon which will put code tags in to format your post better.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: excel VBA insert pagebreak after shape

    This should work... of course since 4 shapes are bigger than a page, it will still look a little strange unless you fit the width to the page in which case it formats ok...

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-06-2011
    Location
    Surrey
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: excel VBA insert pagebreak after shape

    Thank you so much adjusted the size slightly and it format perfect

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Insert title by pagebreak in a certain cell value
    By Danielle22 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-12-2013, 01:26 PM
  2. [SOLVED] Insert Diamond Shape for every Row and add cell value to each shape
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 04-02-2013, 10:10 AM
  3. Replies: 1
    Last Post: 08-04-2010, 12:46 PM
  4. VBA expression to insert pagebreak
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-30-2008, 11:07 AM
  5. insert pagebreak after a specific column?
    By Macroman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 07:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1