Auomatically sizing the height of a row dependnt on the amount of data conatained within?


#1

Hi there,

Im trying to basically ‘autosize’ the height of the row dependant on the daa contained within. Does anyone know how I can achive this?

THanks for your time,

Adam Smith

IS Developer Barnfield College


#2

Dear Adam,

Please try Worksheet.AutoFitRow method.


#3

Am I missing something? That seems to have no affect on the height of the row... I have used both methods but neither resize at all.

Thanks for your reply,

Adam Smith<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


#4

Could you please post your file and sample code? I will check this issue ASAP. Maybe there are some hidden worksheets in your template file.


#5

Hi there,

Sorry about the late reply. <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Holiday and all that.

The code is: -
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

With xlsExcel.Worksheets(0)
.Cells("A89").PutValue("DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA ")
.Cells("A89").Style.IsTextWrapped = True
.AutoFitRow("89")
End With

Thats just snippet of the code but that is the way I am using it.

I just can’t work it out but it is integral to my design.

Thanks for your help,

Adam


#6

And there is the excel spreadsheet


#7

Hi Adam,

AutoFit row doesn’t work on merged cells. That’s same as MS Excel. You can test it in MS Excel.


#8

Ah ok… so if i
put the information into a single unmerged cell
autosize the cell
wrap the information?

I know this may leave a big space at the bottom but its all I can think of…

Thas a bit rubbish on microsofts behalf really… Hmm back to the drawing board.

Thanks for your help,

Adam Smith


#9

You can try to autofit an unmerged cell then merge the cell.