Works perfectly! This forum is the best thing ever. I spent a long time trying this on my own before discovering this community. Thanks to everybody that helped out
I'm trying to tweak that macro now to allow me to apply this same border toggle to an active cell, highlighted cluster of cells, row, or column. I know that i need to insert some "selection" language in there but can't seem to get the right combination. It works well for the first 3 options in the toggle: top, left, and right. Once I get to bottom, however, it gets all messed up
here is what I have below. Please let me know where I went wrong
Dim CurBorder As Long, Brdr As String, B As Variant
With ActiveCell
For Each B In Array(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight)
If Not .Borders(B).LineStyle = xlLineStyleNone Then Brdr = Trim(Brdr & " " & B)
Next
If Len(Brdr) = 0 Then
Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
ElseIf InStr(Brdr, " ") = 0 Then
Selection.Borders(Brdr).LineStyle = xlLineStyleNone
Select Case Brdr
Case xlEdgeTop
Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
Case xlEdgeLeft
Selection.Borders(xlEdgeRight).LineStyle = xlContinuous
Case xlEdgeRight
Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
Case xlEdgeBottom
Selection.BorderAround xlContinuous
End Select
ElseIf Brdr Like "* * * *" Then
Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
Selection.Borders(xlEdgeLeft).LineStyle = xlLineStyleNone
Selection.Borders(xlEdgeRight).LineStyle = xlLineStyleNone
Selection.Borders(xlEdgeBottom).LineStyle = xlLineStyleNone
Selection.Borders(xlEdgeBottom).LineStyle = xlDouble
Else
Selection.Borders(xlEdgeTop).LineStyle = xlLineStyleNone
Selection.Borders(xlEdgeBottom).LineStyle = xlLineStyleNone
End If
End With
End Sub