View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
retseort[_14_] retseort[_14_] is offline
external usenet poster
 
Posts: 1
Default Worksheet_Change even code will not run


Thanks

I made the changes you suggested. Thanks for the Target versus Activ
Cell although I find it odd that it worked under another event. But yo
know this far better than I.

However, I still cannot get this to work right any other ideas or am
still missing the boat.

My new code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
Dim CurrCell As Range
Dim TargetWidth As Single, PossNewRowHeight As Single
Application.EnableEvents = False
If Target.MergeCells Then
With Target.MergeArea
If .Rows.Count = 1 And .WrapText = True Then
.Application.ScreenUpdating = False
.CurrentRowHeight = .RowHeight
.TargetWidth = Target.ColumnWidth
For Each CurrCell In Selection
.MergedCellRgWidth = CurrCell.ColumnWidth
MergedCellRgWidth
Next
.MergeCells = False
.Cells(1).ColumnWidth = MergedCellRgWidth
.EntireRow.AutoFit
.PossNewRowHeight = .RowHeight
.Cells(1).ColumnWidth = TargetWidth
.MergeCells = True
.RowHeight = IIf(CurrentRowHeight PossNewRowHeight, _
CurrentRowHeight, PossNewRowHeight)
End If
End With
End If
Application.EnableEvents = True
End Su

--
retseor
-----------------------------------------------------------------------
retseort's Profile: http://www.excelforum.com/member.php...fo&userid=2469
View this thread: http://www.excelforum.com/showthread.php?threadid=48778