+ Reply to Thread
Results 1 to 2 of 2

Macro to Sort Active Sheet and Set Page Breaks on Columns?

  1. #1
    Registered User
    Join Date
    09-10-2004
    Posts
    18

    Unhappy Macro to Sort Active Sheet and Set Page Breaks on Columns?

    I have this macro that cleans up the active worksheet that a user chooses to run the macro on (from a toolbar button). It changes the column heading, wraps a long column, autofits the text and sets the page setup.

    An issue that I am having is with the page breaks. I need to sort the sheet by column B, and then break the pages on column B's value. So if it is sorted and Column B, Rows 1-3 have the value 000111, then Rows 4-8 have 000113, then there will be a new page starting at column 4.

    This is the code for this portion of my macro:

    Please Login or Register  to view this content.
    When I run it, I get an error, highlighting the 2 from 'Set FromRow = 2' , and the error says "Object Required".

    Can anyone help?

    Thank you!

  2. #2
    Registered User
    Join Date
    09-10-2004
    Posts
    18

    Ok. I have progress but could still use assistance

    I got it working, without error. Now the issue is that it isn't breaking on every number. It breaks on the first different value, but not the next one after that.

    Here is my revised code:
    Please Login or Register  to view this content.
    The data looks exactly like this:

    00000001100
    00000001100
    00000001100
    00000001100
    00000001100
    00000001100
    00000002100
    00000002100
    00000002100
    00000002200
    00000002200
    00000002200

    I have no control over how this looks. It's how it comes to me.

    Any help would be great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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