Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

Prevent insert or delete rows and column with Excel VBA

Is it possible to prevent a user from insert / delete a row or column on a particular worksheet with Excel VBA ?

Tks
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

You can use worksheet protection for this. Why do you want to do this with VBA?
SOLUTION
Avatar of Tej Pratap Shukla ~Dexter
Tej Pratap Shukla ~Dexter
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The VBA for the same is

    ActiveSheet.Protect DrawingObjects:=AllowInsertingColumns:=True, AllowInsertingRows:=True, _
        AllowDeletingColumns:=True, AllowDeletingRows:=True
Avatar of AXISHK
AXISHK

ASKER

How to modify the coding for checking the "INPUT" WORKSHEET only ?

Tks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AXISHK

ASKER

Tks