+ Reply to Thread
Results 1 to 9 of 9

Adding an underline to a row where a certain cell value exists

  1. #1
    Registered User
    Join Date
    06-07-2016
    Location
    Richmond, VA
    MS-Off Ver
    365 Apps for business
    Posts
    82

    Adding an underline to a row where a certain cell value exists

    In the attached xls example I'm looking to add a border underline across the entire row where a certain cell contains the value address type.

    So in the attached example, I want a border at the bottom of each cell across rows 4 and 10.

    I've put a before and after example across two sheets in the xls too.

    What would the vba script need to look like for that?

    VBA question.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: Adding an underline to a row where a certain cell value exists

    Don't need VBA for that. You can use conditional formatting.

  3. #3
    Registered User
    Join Date
    06-07-2016
    Location
    Richmond, VA
    MS-Off Ver
    365 Apps for business
    Posts
    82

    Re: Adding an underline to a row where a certain cell value exists

    Could you advise how to set that up in Conditional Formatting please? I can't see how I would apply a bottom border to the entire row where a cell value is x. I'm only able to apply that formatting to that one cell currently.

  4. #4
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: Adding an underline to a row where a certain cell value exists

    When you create the conditional, there is a button to format it. Go to border then just click the bottom border. You can change the line type (dashed, solid, etc) and the color from there as well. If you want to underline the text, you can also do that from the Font tab.

  5. #5
    Registered User
    Join Date
    06-07-2016
    Location
    Richmond, VA
    MS-Off Ver
    365 Apps for business
    Posts
    82

    Re: Adding an underline to a row where a certain cell value exists

    When I do that, it only applies a border to the cell that contains the value x.

    I need a border applied to the whole row where a cell contains value x.

    Hence me thinking this needs to be a VBA solution.

  6. #6
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: Adding an underline to a row where a certain cell value exists

    So, if the column you are looking at for the value of x was in E, you want to apply this conditional formula to all the columns you want. I will use the assumption that your data is in columns A:E and your x value will appear in column E. So, highlight columns A:E then use this:

    =$E1=x

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Adding an underline to a row where a certain cell value exists

    So much easier for the OP if you assist by setting it up for them in their workbook to illustrate what you are saying.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: Adding an underline to a row where a certain cell value exists

    Here's an example.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-07-2016
    Location
    Richmond, VA
    MS-Off Ver
    365 Apps for business
    Posts
    82

    Re: Adding an underline to a row where a certain cell value exists

    Thank you, that worked

+ 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] underline text within the same cell
    By aarona in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2017, 08:42 PM
  2. [SOLVED] code to check if an oleobject already exists in the specified cell before adding a new one
    By Willardio in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 12-18-2012, 09:14 PM
  3. Highlite or underline active cell row
    By jcarstens in forum Excel General
    Replies: 2
    Last Post: 05-28-2009, 06:01 PM
  4. [SOLVED] Borders nor underline commands remove an unusual underline. ??
    By VideoFreak in forum Excel General
    Replies: 4
    Last Post: 02-11-2006, 04:20 PM
  5. Showing an underline within a cell
    By Roz in forum Excel General
    Replies: 1
    Last Post: 01-06-2006, 05:10 PM
  6. Replies: 2
    Last Post: 11-21-2005, 12:45 PM
  7. Replies: 6
    Last Post: 06-22-2005, 11:05 AM

Tags for this Thread

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