+ Reply to Thread
Results 1 to 2 of 2

Temporarily resize column for Dropdown

  1. #1
    Registered User
    Join Date
    02-06-2015
    Location
    Bad Muenstereifel, Germany
    MS-Off Ver
    7
    Posts
    12

    Temporarily resize column for Dropdown

    Hi All,

    I am trying to temprorarily resize a column to allow the dropdown menu to be fully visible. The following code allows me to do this, but with problems. When I select a column, the width automatically changes (as desired). However, If I select the same column again the width returns to its normal size. Any help would be greatly appreciated.

    Sub Worksheet_SelectionChange(ByVal Target As Range)
    Static Col As Long
    If Target.Count > 1 Then Exit Sub
    If Target.Column >= 27 Then
    Target.Columns.ColumnWidth = 20
    End If
    If Col >= 27 Then
    Columns(Col).ColumnWidth = 5
    End If
    Col = Target.Column
    End Sub



    Cheers

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello Trav66,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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] Code to temporarily allow column width adjustment when specific row is active
    By vamedic11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2015, 05:01 PM
  2. Replies: 3
    Last Post: 12-28-2013, 10:42 AM
  3. Userform>Editing a column temporarily in a sheet for textbox search
    By JustLukas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2013, 02:18 AM
  4. Temporarily highlight column for data input
    By Leif Magnus in forum Excel General
    Replies: 2
    Last Post: 11-15-2012, 06:16 PM
  5. [SOLVED] I could NOT resize the axis title but excel allows me to resize gr
    By Iwan Setiyono Ko in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-05-2006, 11:50 PM
  6. Resize an Excel Column from VB
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2005, 06:05 PM
  7. resize rows and column
    By newbie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2005, 04:06 AM

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