Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot adjustments walrus Excel Discussion (Misc queries) 1 January 18th 10 01:16 PM
Row Height Adjustments Janet Lyn[_2_] Excel Discussion (Misc queries) 3 March 25th 09 02:04 PM
time adjustments Michael Vestel Excel Discussion (Misc queries) 2 November 17th 06 08:46 AM
Adjustments Andy New Users to Excel 4 January 21st 05 02:55 PM
Help! need some adjustments! Simon Lloyd[_402_] Excel Programming 2 April 27th 04 10:03 PM


All times are GMT +1. The time now is 07:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"