Results 1 to 1 of 1

Macro adding Top Border Issue (Inserting instead of adding to pre-existent)

Threaded View

  1. #1
    Registered User
    Join Date
    12-06-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    46

    Macro adding Top Border Issue (Inserting instead of adding to pre-existent)

    Good Afternoon All,
    I'm trying to add a top border to Columns L through N after filtering on Column "B" and customize to just the rows that appear with "Total" in its name.

    The problem is, it will INSERT 3 new columns THEN add the Top-border to the rows as opposed to the already in place L through N columns

    How can I just have it add the top border to the range of L through N on all rows that contain the word "Total"?
    'Filter on "Total" and add borders
        Range("B1").Select
        Selection.Autofilter
        Selection.Autofilter Field:=2, Criteria1:="=*Total*", Operator:=xlAnd
        Range("L:N").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        Selection.Borders(xlEdgeLeft).LineStyle = xlNone
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlMedium
            .ColorIndex = xlAutomatic
        Selection.Autofilter
        End With
    EDIT:
    Found the problem :-)
    Last edited by kibbles; 04-18-2011 at 06:57 PM. Reason: PROBLEM SOLVED

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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