Yes, you can accomplish that with one piece of code.
The code needs to be modified, the old code removed and the modified code placed in a different location.
The modified code will work the same on merged cells as it does now.
'---
The modified code is below. It must be placed in the "ThisWorkbook" module.
It is found in the VBA project window (top left) under the name of your workbook.
'---
Jim Cone
http://www.contextures.com/excel-sort-addin.html
(30+ ways to sort)
'---
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim v As Variant
Dim r As Range
Dim i As Long
v = Array(xlEdgeBottom, xlEdgeTop, xlEdgeRight, xlEdgeLeft)
For Each r In Sh.UsedRange.Cells
With r
For i = 0 To 3
..Borders(v(i)).LineStyle = xlNone
Next
End With
Next
For i = 0 To 3
With Target(1).Borders(v(i))
..LineStyle = xlContinuous
..Weight = xlThick
..ColorIndex = 3
End With
Next
End Sub
'---
..
..
<Dynamo> wrote in message
news:(E-Mail Removed)...
Ignorance is bliss.
Thanks Jim. I worked out how to do it literally about 5 seconds before
your post. Originally was tring to add it as new macro. Doh.
Anyway, have many sheets within spreadsheet and want do same for all
spreadsheets. Is there a way round to have the activecell changed for
all sheets with just one piece of code. And want happens with merged
cells?
Regards
Paul