Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Widen merged columns while selected.

I would like to find out how to change the width of a merged cell or column
while it is selected and then return it back when another cell is selected.

This is the code I have no but does not work on merged areas. I am using
the DV dropdown list and can not read the text in the list becuse the cell is
too narrow. I can't widen the cell because it is a state form and has to be
in this format.... I am all ears if you can help.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim myColumns As Variant
Dim myWidthSelected As Variant
Dim myWidthNormal As Variant
Dim iCtr As Long

myColumns = Array("a", "b")
myWidthSelected = Array(10, 10)
myWidthNormal = Array(1.43, 1.43)

If Target.Count 1 Then Exit Sub

For iCtr = LBound(myColumns) To UBound(myColumns)
If Intersect(Target, _
Me.Cells(1, myColumns(iCtr)).EntireColumn) Is Nothing Then
Me.Cells(1, myColumns(iCtr)).EntireColumn.ColumnWidth _
= myWidthNormal(iCtr)
Else
Me.Cells(1, myColumns(iCtr)).EntireColumn.ColumnWidth _
= myWidthSelected(iCtr)
End If
Next iCtr

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
How do widen columns in a column chart? ITMasterA Charts and Charting in Excel 4 April 4th 23 12:55 PM
Widen Chart Columns RichN Charts and Charting in Excel 3 September 21st 09 03:51 PM
hiding columns with merged rows Cormac Excel Discussion (Misc queries) 3 June 5th 08 01:29 PM
Merged columns in chart [email protected] Excel Discussion (Misc queries) 0 August 22nd 06 04:01 PM
Sort columns containing merged cells. Ron Excel Discussion (Misc queries) 1 May 4th 05 01:08 PM


All times are GMT +1. The time now is 12:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"