+ Reply to Thread
Results 1 to 2 of 2

Macro page breaks on column value not row 1 - use value in footer?

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

    Talking Macro page breaks on column value not row 1 - use value in footer?

    Hi, I have seen some posts that are similar, but no one seems to have the problem that I am having. I will post my macro in this, for anyone that is interested.

    My users get a csv file every month, and we have to clean it up. This macro does that.

    My last issues are this:

    1) having the spreadsheet create page breaks whenever the value in column B changes. Below is just that code.

    Please Login or Register  to view this content.

    The problem that I am having, is that my first page is just row 1. I have row 1 repeat at the top of every page. It does make sense in the code that this value changes, so it makes a page break. Can anyone help me to adjust my code so that it will ignore the first row when it makes the page breaks? The value of B1 will always be the same, so my thought is to make that "If ...Then" statement include something that says not if Cells(X, col) = B1. Make sense?

    Second issue:

    2) I want to take the value in column B, as it will be the same for any given page due to the above page breaks, and put that in the footer.

    I have commented out the code that I was having fun with trying. The idea is that column B is a box number, and I want to have that box number in the footer, so that it is easy to see on the sheet. Here is my page setup code for headers and footers.

    As I said, I commented out the right footer where I would put this code. Any help would be great.


    Please Login or Register  to view this content.
    From the posts I have been reading, you cannot use formulas in the footer. I wish this was not true. My idea was that many formulas or functions could work here. Because I break the page on the value in this column any function that finds the value of any B column cell in the page could be used in this right footer. Like first or last would work.

    Anyway, if I cannot get this second part, I can still deploy the macro. I just need to fix the first part.

    For anyone who is interested, I will post my code in a reply. It is too long as one whole post.

    Thanks!

  2. #2
    Registered User
    Join Date
    09-10-2004
    Posts
    18
    Here is my entire messy code. I started off with what we had, recorded portions to do more, and added bits and pieces together.
    Be warned that I am not advanced at Excel macros, so it is a messy one.
    It is not organized at all, but it works!

    Please Login or Register  to view this content.
    Thanks again!

+ 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