Thread: Column Delete
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default 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!