Widening Validation Box

G

Guest

I have found an earlier reference on how to temporarily widen a validation
box using target.columns.columnwidth. Is there a way I can do this ONLY when
a specific validation box is being used, i.e. I do not want to temporarily
widen the column every time a cell is active, only one or two cells. Thank
you
 
B

Bob Phillips

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Target
If .Count > 1 Then Exit Sub
If .Address = "$B$5" Or .Address = "$H$8" Then
.Columns.ColumnWidth = 20
Else
Columns(2).ColumnWidth = 5
Columns(8).ColumnWidth = 5
End If
End With
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top