Prevent Column adjustments?
Hi All.............
I have these two nifty pieces of code given to me by kind folks in this group. They work beautifully to prevent the User from accessing the "Format Painter" feature. Could someone please tell me how they could be modified to instead, prevent the Width-adjustment of Columns by casual users, and furthermore, how to prevent the Hiding of Columns? Private Sub Workbook_Activate() Dim ctl As CommandBarControl For Each ctl In Application.CommandBars("Standard").Controls If ctl.Caption = "&Format Painter" Then ctl.Enabled = False End If Next End Sub Private Sub Workbook_Deactivate() Dim ctl As CommandBarControl For Each ctl In Application.CommandBars("Standard").Controls If ctl.Caption = "&Format Painter" Then ctl.Enabled = True End If Next End Sub TIA Vaya con Dios, Chuck, CABGx3 |
Prevent Column adjustments?
protecting the worksheet is one way
"CLR" wrote: Hi All............. I have these two nifty pieces of code given to me by kind folks in this group. They work beautifully to prevent the User from accessing the "Format Painter" feature. Could someone please tell me how they could be modified to instead, prevent the Width-adjustment of Columns by casual users, and furthermore, how to prevent the Hiding of Columns? Private Sub Workbook_Activate() Dim ctl As CommandBarControl For Each ctl In Application.CommandBars("Standard").Controls If ctl.Caption = "&Format Painter" Then ctl.Enabled = False End If Next End Sub Private Sub Workbook_Deactivate() Dim ctl As CommandBarControl For Each ctl In Application.CommandBars("Standard").Controls If ctl.Caption = "&Format Painter" Then ctl.Enabled = True End If Next End Sub TIA Vaya con Dios, Chuck, CABGx3 |
Prevent Column adjustments?
Yeah, I was just wanting to turn off that one feature if I could with VBA
but maybe the Worksheet Protection would be better in the long run........I'll have to think on that one some more............thanks for the response Vaya con Dios, Chuck, CABGx3 "gocush" wrote in message ... protecting the worksheet is one way "CLR" wrote: Hi All............. I have these two nifty pieces of code given to me by kind folks in this group. They work beautifully to prevent the User from accessing the "Format Painter" feature. Could someone please tell me how they could be modified to instead, prevent the Width-adjustment of Columns by casual users, and furthermore, how to prevent the Hiding of Columns? Private Sub Workbook_Activate() Dim ctl As CommandBarControl For Each ctl In Application.CommandBars("Standard").Controls If ctl.Caption = "&Format Painter" Then ctl.Enabled = False End If Next End Sub Private Sub Workbook_Deactivate() Dim ctl As CommandBarControl For Each ctl In Application.CommandBars("Standard").Controls If ctl.Caption = "&Format Painter" Then ctl.Enabled = True End If Next End Sub TIA Vaya con Dios, Chuck, CABGx3 |
All times are GMT +1. The time now is 02:06 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com