Sub Macro1()
'updateby Extendoffice 20160616
'update by p45cal vbaExpress 20170624
Dim xEndCol As Long, xEndRow As Long
Dim I As Long
On Error Resume Next
xEndCol = Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
xEndRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Application.ScreenUpdating = False
For I = xEndCol To 1 Step -1
If Application.WorksheetFunction.CountA(Columns(I)) <= 1 Then
With Cells(1, I - 1).Resize(xEndRow).Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
With Cells(1, I + 1).Resize(xEndRow).Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 6
End With
Columns(I + 1).Cells(1).Interior.ColorIndex = 6
Columns(I).Delete
End If
Next
Application.ScreenUpdating = True
End Sub