Hello
I am struggling with a code and need help.
I have a range of cells which are merged from col C to col P in each row for about 20 consecutive rows. Each merged cell has long text and I need to adjust row height according to the text length.
I have mentioned the row height in the Col B of the same row. I want to adjust the row height of each cell in C30 to C46 according the col B value of the same row.
I tried to make the macro as follows. But I believe cells object cannot be used with offset command.
Can someone help in setting the code right.
Thanks in advance
Sub Prnt_SpecsRowHt()
For Each cell In Sheets("360 LM Prnt").Range("C30:C46")
.EntireRow.RowHeight = cell.Offset(0, -1).Value
Next cell
End Sub
The text value of C30 to C46, I am bringing with following code
Sheets("360 LM Prnt").Range("SpecL12_360").Value = Sheets("SpecMaster").Range("Spec_UVMS6").Value
Sheets("360 LM Prnt").Range("SpecL12_360").RowHeight = Sheets("SpecMaster").Range("Spec_UVMS6").Offset(0, -1).Value
I am struggling with a code and need help.
I have a range of cells which are merged from col C to col P in each row for about 20 consecutive rows. Each merged cell has long text and I need to adjust row height according to the text length.
I have mentioned the row height in the Col B of the same row. I want to adjust the row height of each cell in C30 to C46 according the col B value of the same row.
I tried to make the macro as follows. But I believe cells object cannot be used with offset command.
Can someone help in setting the code right.
Thanks in advance
Sub Prnt_SpecsRowHt()
For Each cell In Sheets("360 LM Prnt").Range("C30:C46")
.EntireRow.RowHeight = cell.Offset(0, -1).Value
Next cell
End Sub
The text value of C30 to C46, I am bringing with following code
Sheets("360 LM Prnt").Range("SpecL12_360").Value = Sheets("SpecMaster").Range("Spec_UVMS6").Value
Sheets("360 LM Prnt").Range("SpecL12_360").RowHeight = Sheets("SpecMaster").Range("Spec_UVMS6").Offset(0, -1).Value