Home Excel Powerpoint Word Outlook Error Codes

VBA Useful Codes

Welcome to the World of VBA
Home > VBAUsefulCodes

Lock specific Column using Excel VBA


This sample code provides the functionality to lock specific column in excel using vba macros. This will give us the flexibility to restrict the users to edit only certain columns.

Sub Lock_Column()
ActiveSheet.Unprotect
Cells.Locked = False
Columns("A:A").EntireColumn.Locked = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
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