Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Make Dropdown List Temporarily Wider & Same Width for Multiple Col

Hi,
How do I modify the following macro from
http://www.contextures.com/xlDataVal08.html#Wider to make the dropdown list
temporarily wider for say COLUMNS BETWEEN 1 and 10, without having to specify
columns individually, e.g. Target.Column = 1, Target.Column = 2, etc.

Is there some sort of BETWEEN COMMAND I can use?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target.Column = 4 Then
Target.Columns.ColumnWidth = 20
Else
Columns(4).ColumnWidth = 5
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Make Dropdown List Temporarily Wider & Same Width for Multiple Col

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "A:E" '<======= change to suit
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Target.Columns.ColumnWidth = 20
Else
Columns(4).ColumnWidth = 5
End If
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"AK9955" wrote in message
...
Hi,
How do I modify the following macro from
http://www.contextures.com/xlDataVal08.html#Wider to make the dropdown
list
temporarily wider for say COLUMNS BETWEEN 1 and 10, without having to
specify
columns individually, e.g. Target.Column = 1, Target.Column = 2, etc.

Is there some sort of BETWEEN COMMAND I can use?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target.Column = 4 Then
Target.Columns.ColumnWidth = 20
Else
Columns(4).ColumnWidth = 5
End If
End Sub



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
Help with Macro - Make Dropdown List Temporarily Wider AK9955 Excel Discussion (Misc queries) 2 April 27th 07 03:16 PM
How to make fx field wider? [email protected] Excel Discussion (Misc queries) 3 July 10th 06 11:12 PM
Dropdown list width changing code XXL User Excel Worksheet Functions 1 June 26th 06 09:11 PM
Make input in one column determine dropdown list in another. gettin-older Excel Discussion (Misc queries) 4 November 13th 05 10:42 PM
How can I allow users to make multiple selections from a dropdown. Liz Excel Worksheet Functions 0 February 17th 05 05:21 AM


All times are GMT +1. The time now is 10:01 AM.

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"