Wednesday, December 12, 2012

Cell Border in Excel

Apply Cell Border in Excel:-

Function BorderLine()


'Put Border line in selected cells.

Selection.Borders(xlEdgeTop).LineStyle = xlContinuous

Selection.Borders(xlEdgeTop).Weight = xlThin

Selection.Borders(xlEdgeTop).ColorIndex = xlAutomatic

Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous

Selection.Borders(xlEdgeBottom).Weight = xlThin

Selection.Borders(xlEdgeBottom).ColorIndex = xlAutomatic

Selection.Borders(xlEdgeRight).LineStyle = xlContinuous

Selection.Borders(xlEdgeRight).Weight = xlThin

Selection.Borders(xlEdgeRight).ColorIndex = xlAutomatic

Selection.Borders(xlInsideVertical).LineStyle = xlContinuous

Selection.Borders(xlInsideVertical).Weight = xlThin

Selection.Borders(xlInsideVertical).ColorIndex = xlAutomatic

Selection.Borders(xlInsideHorizontal).LineStyle = xlContinuous

Selection.Borders(xlInsideHorizontal).Weight = xlThin

Selection.Borders(xlInsideHorizontal).ColorIndex = xlAutomatic

End Function

No comments: