+ Reply to Thread
Results 1 to 5 of 5

Macro | Create border under certain rows

  1. #1
    Registered User
    Join Date
    08-20-2014
    Location
    San Mateo, CA
    MS-Off Ver
    2010
    Posts
    86

    Macro | Create border under certain rows

    Hello,

    If you guys could help me with this, that would be great. I've been able to create a macro that completed about 75% of the formatting, but there's a few other items I need formatted to make it work perfectly.

    1. If you take a look at column B, you'll see "Name1, Name2, etc" and I need to enter VBA coding so that anytime a name is found it will create a underline border from column A to column W. This is difficult for me because I don't know how to make the macros smart enough to know which rows to underline. The data can always be different so it can't be set to a range of cells.

    2. move each of the fields (name 1, name 2, etc..) in column B (category1) and paste to column C (category2) and then delete category 1 column.

    3. highlight row with a field (Status3) in column C to where the entire row is highlighted yellow.

    4. I know which formula to enter into C4:E10 which is basically going to sum a column based on status in category 2. The problem is, how do I make the macro smart enough to know what row number to end at. For instance, if you enter =sum(E14:??)... what if the first data set goes to 150, then the next is 450, what do you enter in VBA to where it can determine the end of the table?

    THANK YOU SO MUCH!!!!!

    Macro - create borders formulas.xlsx

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Macro | Create border under certain rows

    I recorded a macro to put a bottom border on a cell and included it in this code.

    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro | Create border under certain rows

    Maybe:

    Please Login or Register  to view this content.
    Not sure about your Sum question what exactly do you want too Sum? The entire Column E?

  4. #4
    Registered User
    Join Date
    08-20-2014
    Location
    San Mateo, CA
    MS-Off Ver
    2010
    Posts
    86

    Re: Macro | Create border under certain rows

    Thank you both so much! Dflank that worked absolutely perfectly! What programming could you use for highlighting a row yellow based on a certain status?

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Macro | Create border under certain rows

    Quote Originally Posted by Thanks4helping View Post
    Thank you both so much! Dflank that worked absolutely perfectly! What programming could you use for highlighting a row yellow based on a certain status?
    Look up Conditional Formatting. There are several ways to apply conditional formatting. My suggestion is to highlight the range to which you want to apply the formatting first and then apply the formatting. It just seems easier for me to do it that way.

    There are also about a half dozen different formats you can apply. Some of them apply to the range - applying color gradients, stop lights and other icons based on the cell's relative value within the range. Some apply to a cell based on its own "merit" - these are either "where cell contains" or "use a formula" in nature.

    If you are using a formula pay particular attention to absolute and relative referencing of the cells used in the formula.

+ 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] Excel Macro to Add Buttom Double Border to Rows Based on Criteria
    By eitan932 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2016, 07:02 AM
  2. Create VBA Macro to create new rows according to data between Sheet1 and Sheet2
    By kcarth in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2015, 02:06 PM
  3. [SOLVED] Excel Macro to Add Buttom Double Border to Rows Based on Criteria
    By eitan932 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2014, 05:17 AM
  4. VBA: Macro fo inserting rows with border
    By bamaisgreat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2014, 09:49 AM
  5. [SOLVED] Mysterious additional border to left of rows border?
    By Oppressed1 in forum Excel General
    Replies: 2
    Last Post: 10-10-2012, 03:22 PM
  6. Create Border Using only Visible Rows
    By EzRouter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2012, 03:47 PM
  7. vba-create an automatic border
    By janjan_376 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-20-2008, 10:15 AM

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