+ Reply to Thread
Results 1 to 5 of 5

Macro code to do multiple tasks such as deleting rows, inserting borders and page breaks

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Macro code to do multiple tasks such as deleting rows, inserting borders and page breaks

    Hi,

    I use excel the entire day and i'm looking for a code to complete a multiple tasks. Please, I would greatly it appreciate if anyone can help.
    Book1.xlsx

    I have here information that I've imported from another chart.
    I would like to accomplish the following tasks using macros:

    1) delete any rows that contain a "0" or nothing in column B automatically
    2) right below the last row that contains information I would like to border two cells with a box as shown and fill the cells in the color yellow.
    3) in that box I would like to have the left cell contain the text "total" and the right cell to auto-sum everything in column B.
    4) and last but not least I would like to automatically have the page break (for printing purposes) to be right below the boxed cells and having peace of mind that every bit of information on the spreadsheet will be printed.

    Thank you :-)

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Macro code to do multiple tasks such as deleting rows, inserting borders and page brea

    Hi,

    Try this:

    Please Login or Register  to view this content.
    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Macro code to do multiple tasks such as deleting rows, inserting borders and page brea

    I tried it and it did the job for everything besides the pagebreak. I thank you for your work and efforts :-) but if you can please fix this one issue I would really appreaciate it.
    Also, is it possible to make one border around those last cells instead of around each cell? I'm sorry i'm being finicky but this makes a difference to the spreadsheet we prepare at my workplace.
    Thank you again for your efforts and looking forward to hearing from you again.

  4. #4
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Macro code to do multiple tasks such as deleting rows, inserting borders and page brea

    I tried the code and it did the job for everything besides the pagebreak. I thank you for your work and efforts :-) but if you can please fix this one issue I would really appreaciate it.
    Also, is it possible to make one border around those last cells instead of around each cell? I'm sorry i'm being finicky but this makes a difference to the spreadsheet we prepare at my workplace.
    Thank you again for your efforts and looking forward to hearing from you again.

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Macro code to do multiple tasks such as deleting rows, inserting borders and page brea

    Hi,

    I'm not sure I understand either of your requests:

    1) The pagebreak is inserted as required when I test it.
    2) Only a single border appears around the two cells in question when I test it.

    Perhaps you could post the workbook on which you are running the code? I can only imagine you are running it on a version of your original attachment which has significant differences from that version to account for the issues you are facing. By the way, have you tried running the code on that original attachment?

    Regards

+ 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. Replies: 0
    Last Post: 06-13-2012, 08:09 AM
  2. Inserting Page Breaks in Existing Macro
    By duckbriggs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2011, 05:35 PM
  3. Inserting Page Breaks on relative Rows based on Data
    By Tirren in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2008, 07:38 PM
  4. Page Breaks and Borders
    By dbpeters in forum Excel General
    Replies: 0
    Last Post: 04-28-2006, 03:55 PM
  5. [SOLVED] inserting multiple page breaks at one time
    By JPRENDER in forum Excel General
    Replies: 0
    Last Post: 03-22-2006, 12:50 PM

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