Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot adjustments | Excel Discussion (Misc queries) | |||
Row Height Adjustments | Excel Discussion (Misc queries) | |||
time adjustments | Excel Discussion (Misc queries) | |||
Adjustments | New Users to Excel | |||
Help! need some adjustments! | Excel Programming |