Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Help with Macro - Make Dropdown List Temporarily Wider

Sorry I'm not a Programmer, so would appreciate your help with the following
macro I pulled from the contextures.com site (thanks to Bob).

Using below macro I was able to make ONE dropdown list temporarily wider.
Hooray. However, when I tried to make another dropdown list (within same
worksheet) temporarily wider, I was at a loss as to how to edit the code.
Tried & tried and I'm tired! Can someone edit below macro to include ANOTHER
DROPDOWN LIST (i.e. column) so I can figure out how its done.

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

Thanks so much, Anna.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Help with Macro - Make Dropdown List Temporarily Wider

The key is the fourth line. The code looks for column #4 (column D ). Lets
say we want the code to work on both column D and column J. Instead of:

If Target.Column = 4 Then

use:

If Target.Column = 4 OR Target.Column = 10 Then


--
Gary''s Student - gsnu200717
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Help with Macro - Make Dropdown List Temporarily Wider

Thanks Gary, I understand what your saying. However, what if I want the
column widths to be different for my lists? I wouldn't use an OR statement,
would I?

"Gary''s Student" wrote:

The key is the fourth line. The code looks for column #4 (column D ). Lets
say we want the code to work on both column D and column J. Instead of:

If Target.Column = 4 Then

use:

If Target.Column = 4 OR Target.Column = 10 Then


--
Gary''s Student - gsnu200717

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
Making data validation drop down list wider Steve E Excel Discussion (Misc queries) 5 August 15th 06 05:15 PM
How to make fx field wider? [email protected] Excel Discussion (Misc queries) 3 July 10th 06 11:12 PM
Procedure to make a dropdown list larger so it's easier to read Jack Oziel Excel Discussion (Misc queries) 4 December 26th 05 05:49 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 to make an input in one column determine dropdown list in anot gettin-older Excel Worksheet Functions 6 November 13th 05 09:34 PM


All times are GMT +1. The time now is 10:11 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"