I pressed the "Wrap Text" button in the UI and recorded VBA.
This is the VBA that was recorded:
If i have a cell selected that will change the Row Height if the Wrap Text UI is pressed, it does the same if i execute this macro.
But then, i have the following macro (and i have tried a few variations of it). It was recorded with the exact same recording that should cause the Row Hight to be adjusted. But yet, as code, it is simply ignored. The code is executed (you can see it by stepping), but the Row Height is not changed. The result is as if that code block (With Selection...) was not there.
Any thoughts?
Is this an Excel bug? Is there something i can do to the code to change this behavior and get the .WrapText = False to be executed correctly in the VBA?
This is the Macro where the code is ignored:
This is the VBA that was recorded:
VBA Code:
Sub Macro5()
'
' Macro5 Macro
'
'
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub
If i have a cell selected that will change the Row Height if the Wrap Text UI is pressed, it does the same if i execute this macro.
But then, i have the following macro (and i have tried a few variations of it). It was recorded with the exact same recording that should cause the Row Hight to be adjusted. But yet, as code, it is simply ignored. The code is executed (you can see it by stepping), but the Row Height is not changed. The result is as if that code block (With Selection...) was not there.
Any thoughts?
Is this an Excel bug? Is there something i can do to the code to change this behavior and get the .WrapText = False to be executed correctly in the VBA?
This is the Macro where the code is ignored:
VBA Code:
Sub Comment_Out()
Application.Calculation = xlCalculationManual
Sheets("AL2019").Select
Range("Main[[#Headers],[MainTyp]]").Select
Selection.Offset(1, 0).Select
Selection.Formula = "'" & Selection.Formula
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range(Selection, Selection.End(xlDown)).Select
Selection.FillDown