Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    in excel 2007 how can i lock the width of a column? maually? and using code

    many thanks

    diana

  2. #2
    3 Star Lounger
    Join Date
    Feb 2003
    Location
    Runcorn, Cheshire, United Kingdom
    Posts
    372
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Diana View Post
    in excel 2007 how can i lock the width of a column? maually? and using code

    many thanks

    diana
    Protecting the sheet will prevent users from changing the width, but it may be more than you need.

  3. #3
    New Lounger
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could add workbook macros:

    Code:
    ' examples checking for minimum size for column A
    
    
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    If Columns("a:A").ColumnWidth < 12 Then Columns("a:A").ColumnWidth = 12 
    MsgBox ("before save")
    End Sub
    
    Private Sub Workbook_Open()
    If Columns("a:A").ColumnWidth < 12 Then Columns("a:A").ColumnWidth = 12 
    MsgBox (" On Open ")
    End Sub
    
    
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    If Columns("a:A").ColumnWidth < 12 Then Columns("a:A").ColumnWidth = 12 
    End Sub

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ill test out both your suggestions.

    many thanks


    diana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •