Prevent Column adjustments?

  • Thread starter Thread starter CLR
  • Start date Start date
C

CLR

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top