+ Reply to Thread
Results 1 to 9 of 9

Excel new rows don't have column border

Hybrid View

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Excel new rows don't have column border

    Hello,

    I have an excel spreadsheet connected to live data. The rows will constantly change and when new rows get added, the right column border isn't there. Is there a way I can get around this. I won't know the end row to hard code a range, but basically just want new rows to get a right column border on A##.

    Thanks in advance,

    Jason Silva

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Excel new rows don't have column border

    need your code
    If solved remember to mark Thread as solved

  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: Excel new rows don't have column border

    patel45 is right you should provide your code. See if this helps.

    Sub Gulsath()
    With Range("A" & Rows.count).End(3)(1).Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlMedium
        .ColorIndex = xlAutomatic
    End With
    End Sub

  4. #4
    Registered User
    Join Date
    10-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel new rows don't have column border

    Thanks guys, I have this right now...

    Sub AddColumnBorder()

    Dim rw As Range
    Dim cCell

    For Each rw In Range("A5:A50000")
    If rw.Value <> "Grand Total" Then
    rw.Cells.Borders(xlEdgeRight).LineStyle = xlContinuous
    End If
    Next

    End Sub

    But it doesn't stop at Grand Total, it goes right down to 50,000. In my case it should have stopped at A350. John, the blurb didn't put any borders in but thank you for posting it.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Excel new rows don't have column border

    For e.g

    rw.Resize(, 15).Borders(xlEdgeRight).LineStyle = xlContinuous
    Goes form A to O

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Excel new rows don't have column border

    Please use code tags with your code.

    How many "Grand Total" do you have?

    This line is wrong.

     rw.Cells.Borders(xlEdgeRight).LineStyle = xlContinuous
    Sub test1()
    Dim rw As Range
        For Each rw In Range("A5", Range("A" & Rows.Count).End(xlUp))
            If rw.Value <> "Grand Total" Then
                rw.Cells.Borders(xlEdgeRight).LineStyle = xlContinuous
            End If
         Next
    End Sub

  7. #7
    Registered User
    Join Date
    10-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel new rows don't have column border

    k, I tried it, it worked perfect, thanks, on the next....

  8. #8
    Registered User
    Join Date
    10-22-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel new rows don't have column border

    Just the one Grand Total, will try your suggestion in a bit, got some calls to jump on.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Excel new rows don't have column border

    Use this code.

    Sub test1()
    Dim rw As Range, LR&
        LR = Cells.Find("Grand Total", , , , xlByRows, xlPrevious).Row
        Cells(LR, 1).Resize(, 15).Borders(xlEdgeRight).LineStyle = xlContinuous
    End Sub

+ 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] Mysterious additional border to left of rows border?
    By Oppressed1 in forum Excel General
    Replies: 2
    Last Post: 10-10-2012, 03:22 PM
  2. Create Border Using only Visible Rows
    By EzRouter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2012, 03:47 PM
  3. Border for row, 10 extra rows with borders
    By anno1404 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2011, 05:05 AM
  4. Replies: 0
    Last Post: 08-16-2006, 02:25 PM
  5. Macro to border row from start column to end column
    By malik641 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2005, 06:09 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