The IF statement below was part of a larger macro and used to enable the wrap text option when it was run from Sheet2.
We have since added more worksheets to our file and would like to run the entire macro from Sheet1 and have it enable the wrap text option on multiple sheets. I tried using the lines below but it doesn't work. Everything else I tried failed in the debugger.
Code:
If ActiveSheet.Name = "Sheet2" Then
Range(Range("M22"), Range("M22").End(xlDown)).WrapText = True
End If
We have since added more worksheets to our file and would like to run the entire macro from Sheet1 and have it enable the wrap text option on multiple sheets. I tried using the lines below but it doesn't work. Everything else I tried failed in the debugger.
Code:
Sheets("Sheet2").Range("M22").End(xlDown).WrapText = True
Sheets("Sheet4").Range("C20").End(xlDown).WrapText = True