Results 1 to 4 of 4

Cell Borders

Threaded View

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    California
    Posts
    8

    Cell Borders

    So I have the following code written. What kind of For statement can be written to make this work for a cell range. Eventually the code will make each cell a different color border. I also want it to skip over empty cells.



    If Application.WorksheetFunction.IsText(Range("C5")) Then
       Range("C5:E5").Select
       Selection.Borders(xlDiagonalDown).LineStyle = xlNone
       Selection.Borders(xlDiagonalUp).LineStyle = xlNone
       With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlThick
            .ColorIndex = 6
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlThick
            .ColorIndex = 6
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlThick
            .ColorIndex = 6
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlThick
            .ColorIndex = 6
        End With
        
    End If
    Last edited by rylo; 09-11-2008 at 11:37 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Protected Formulas
    By georgeeasten in forum Excel General
    Replies: 13
    Last Post: 12-10-2018, 12:47 AM
  2. make it so text transcends cell borders
    By mufan in forum Excel General
    Replies: 1
    Last Post: 08-11-2008, 02:12 PM
  3. Cell linked to a "wandering" cell
    By BigKahuna in forum Excel General
    Replies: 1
    Last Post: 02-29-2008, 12:27 PM
  4. Trouble with Excel Formula?
    By Beev in forum Excel General
    Replies: 4
    Last Post: 05-10-2007, 04:26 PM
  5. Pulling a worksheet name from cell value (custom function needing help)
    By Kurisu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-21-2006, 09: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