Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Column Delete
Hi
I created this simple macro through use of the recorder... Private Sub commandbutton4_click() Columns(ActiveCell.Column).Delete End Sub It works fine, but I would like to protect Col 1:3 from being deleted. I would also like to add worksheet protection but the code wont run if the sheet is protected and if I add Unprotect to the code then Col 1:3 would still be able to be deleted. How can I modify to accomplish this. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Column Delete
Private Sub commandbutton4_click() If Activecell.Column 3 then Columns(ActiveCell.Column).Delete End Sub "Henry" wrote: Hi I created this simple macro through use of the recorder... Private Sub commandbutton4_click() Columns(ActiveCell.Column).Delete End Sub It works fine, but I would like to protect Col 1:3 from being deleted. I would also like to add worksheet protection but the code wont run if the sheet is protected and if I add Unprotect to the code then Col 1:3 would still be able to be deleted. How can I modify to accomplish this. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy column header to next column, delete & delete every nth colum | New Users to Excel | |||
delete cells column. Delete empty cells | Excel Worksheet Functions | |||
Look for value in a column and delete | Excel Programming | |||
Delete All Rows That Column A value is not in Column A of Sheet2 | Excel Programming | |||
Delete a Row if a Certain Value is in Column C | Excel Programming |