How to prevent user to insert / delete column?

seageath

Board Regular
Joined
Oct 29, 2009
Messages
102
Hi all,

Need help for this one, I try to detect if there is an inserted / deleted column in my worksheet. So far I only got how to set them in Worksheet.Sheetchange event:

Code:
If selection.Address = selection.EntireColumn.Address Then
        MsgBox ("You have made damaging modifications to the project sheet")
        ' Need the code here
        Exit Sub
End If

I only want to prevent user to insert / delete the column.
Appreciate for all the help.

-sea-
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You could protect the worksheet and allow them to do everything except insert and delete rows. No code required.
 
Upvote 0
You could protect the worksheet and allow them to do everything except insert and delete rows. No code required.

I want to do this using macro, since these worksheet will be distributed to the user but only allowed them to modify specific worksheet.
 
Upvote 0
I don't understand your reasoning. Using worksheet protection will always work; doing it by a macro will not work unless the user actually enables macros.
 
Upvote 0
I don't understand your reasoning. Using worksheet protection will always work; doing it by a macro will not work unless the user actually enables macros.

We have project's worksheet for several users. We use macro since we are implementing macros for

- log the update-
- insert new row
- update the value
- upload the update to database

but users can not insert or delete column since it will damages the calculation of entire workbook.

Hope it's clear why we need to implement macros.

-sea-
 
Upvote 0
No, sorry, it's still not clear. I understand that you're using macros but I don't understand why you'd want to go to the complexity of implementing this sort of functionality in VBA when it's already provided as a basic function of the worksheet.

Thanks for explaining but I think I'll dip out at this point and leave this for someone else to respond to.
 
Upvote 0
No, sorry, it's still not clear. I understand that you're using macros but I don't understand why you'd want to go to the complexity of implementing this sort of functionality in VBA when it's already provided as a basic function of the worksheet.

Thanks for explaining but I think I'll dip out at this point and leave this for someone else to respond to.

Thanks for your pov

-sea-
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top