+ Reply to Thread
Results 1 to 5 of 5

Code to execute multiple tasks such as deleting rows, inserting sums, setting print area

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

    Smile Code to execute multiple tasks such as deleting rows, inserting sums, setting print area

    Hey everybody,

    I'm looking for a macro code to accomplish multiple tasks so that we can save time.

    This is how the chart looks like at first glance: test1.xlsx

    There are 5 steps that I would like to do:

    A) In the above attachment I would like to have cells "D18" & "E18", which each have a formula entered into them, copied as values into each cell going down columns "D" & "E" like this : test2.xlsx
    B) Then I would like to delete any row in column "C" that has a "0" or a "" (blank) in them so it would look like this: test3.xlsx *please note that any blanks above row 17 is not counted for the deletion code.
    C) Next I would like to automatically add, underneath the last cells that have data in them, a border surrounding cells A,B,C,D & E as shown here: test4.xlsx and that it should be filled in with a light grey color as shown, with the text "Total" on column "B", the sum total on column "C", the text "Total Cost" on column "D" and the sum total on column "E". And please keep all texts centered vertically and horizontally and in bold (WHEW! Hope this isn't too confusing )
    D) The last thing I need is to have the print area to be set underneath the last row that has data in them. So in this attachment: test5.xlsx I would like to have up until the last line with data in it to be included in the print.

    I hope this is possible and if anyone can create this code please let me know as this would be a great help.

    Thank you :-)
    Last edited by kosherboy; 12-03-2013 at 01:37 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to execute multiple tasks such as deleting rows, inserting sums, setting print ar

    Give this a whirl:

    Please Login or Register  to view this content.

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

    Re: Code to execute multiple tasks such as deleting rows, inserting sums, setting print ar

    Wow! Unbelievable! Thank you 99% of it worked perfectly except for the color tone on the bottom. That's the only thing left. Is there any chance you can add that to the code?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Code to execute multiple tasks such as deleting rows, inserting sums, setting print ar

    Your test4 workbook did not have a color tone. If you want to add an interior color of light grey just add this line of code in the corresponding spot

    Please Login or Register  to view this content.
    In addition, please amend the last line which says:
    Application.ScreenUpdating = False

    to
    Application.ScreenUpdating = True

    It was a mistake on my part.

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

    Re: Code to execute multiple tasks such as deleting rows, inserting sums, setting print ar

    Thank you! You totally helped me out.
    Take care.

+ 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: 4
    Last Post: 12-04-2013, 05:32 AM
  2. Setting print area with code
    By rmunsun1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2011, 06:55 AM
  3. Print Area:What would be the code for setting the print area
    By wammer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2005, 02:05 AM
  4. Setting more parameters with Print area code
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-08-2005, 12:05 PM
  5. Help with code setting print area
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-30-2005, 08:05 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