Home Excel Powerpoint Word Outlook Error Codes

VBA Useful Codes

Welcome to the World of VBA
Home > VBAUsefulCodes

Apply Borders to Excel Sheet


Apply Borders to Specific Range of cells using VBA. Border Variations & Colours can be customized according to needs

Sub apply_borders()

shtname = "Sheet1"

With ThisWorkbook.Sheets(shtname).UsedRange.Select

    With Selection.Borders()

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

    

End With

End Sub

Subscribe

Enter your e-mail below and get notified on the latest blog posts.




Tags

VBA Outlook KPI Excel Alt+F11 Dashboards Macros Recording Graphs Automation Developer WaterFall Powerpoint Charts Pivot Tables Forecast Charts


Follow Us