+ Reply to Thread
Results 1 to 3 of 3

Code to temporarily allow column width adjustment when specific row is active

  1. #1
    Registered User
    Join Date
    01-08-2010
    Location
    Sussex County, Delaware
    MS-Off Ver
    Excel 2013
    Posts
    40

    Code to temporarily allow column width adjustment when specific row is active

    I have the below code in ThisWorkbook, the only problem is, with worksheet protection enabled, it generates a runtime error. I know I can update the protection to allow this but I only want the column to be widened while a specific row is selected (either row 3 or 4 depending on the sheet). Once that row is not active anymore, I want the column width to go back to four. Can this code be modified to allow for this?

    Thanks,
    Don



    Please Login or Register  to view this content.
    Station 101 Vehicle and Gear Checks - Sample.xlsm

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Code to temporarily allow column width adjustment when specific row is active

    VBA does not trump protected sheets.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code to temporarily allow column width adjustment when specific row is active

    Here's the code that I had written previously - you'll need to add the passwords

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Column Width Adjustment
    By JerryA in forum Excel General
    Replies: 3
    Last Post: 04-11-2006, 08:35 PM
  2. [SOLVED] Automatic column width adjustment
    By Senator in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1