+ Reply to Thread
Results 1 to 5 of 5

auto column width resizing

  1. #1
    Registered User
    Join Date
    07-07-2012
    Location
    Manila
    MS-Off Ver
    Excel 2003
    Posts
    6

    Unhappy auto column width resizing

    lets say i type for now...
    A1 = USA
    B1 = Philippines

    and then later
    A1 = dog
    B1 = cat

    is there a way that the width would automatically adjust even as i change the values of the given cells; meaning, if a word is long, the width will automatically adjust "longer", if a word is short, then it will automatically adjust "shorter".
    i know how the "AutoFit Column Width" works but i dont want to press that everytime my values change (words becoming shorter or longer). Thanks

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: auto column width resizing

    Put this code in the worksheet module:
    Please Login or Register  to view this content.
    Edited to be simpler!
    Last edited by Olly; 02-13-2014 at 08:22 AM. Reason: Made code simpler
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-07-2012
    Location
    Manila
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: auto column width resizing

    i went to VBA but i dont see a worksheet module. im only seeing "Sheet1 (Sheet1)" & "ThisWorkbook" or maybe im only already looking at it? sorry, im a beginner here esp with vba stuff.

  4. #4
    Registered User
    Join Date
    07-07-2012
    Location
    Manila
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: auto column width resizing

    GOT IT! it worked. i pasted the code in Sheet1 (Sheet1). its now automated THE only thing is the if i want to undo something it wont work. running macros i guess kills the undo switch. the undo can be incorporated in the code but i guess that would be too much a burden; that would be going too deep as mentioned here http://www.excelforum.com/excel-prog...o-running.html

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: auto column width resizing

    Well done for figuring out where to put it. Glad it's working for you.

    And good for you for searching the Undo problem.

+ 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. [SOLVED] Listbox auto fit column width
    By sthiru in forum Excel General
    Replies: 13
    Last Post: 07-21-2021, 03:31 AM
  2. Min Column width, else auto fit
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2012, 08:12 AM
  3. Auto-resize Column Width
    By dk54 in forum Excel General
    Replies: 3
    Last Post: 03-29-2011, 10:55 PM
  4. auto fit column width and row height
    By kb in forum Excel General
    Replies: 0
    Last Post: 05-22-2006, 03:00 PM
  5. Auto Adjust the Width of a Column
    By reddog9069 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 12:10 PM

Tags for this Thread

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