Hi,
I tried to make a VBA code which would autofit all rows in worksheet.
I wrote this kind of code:
Private Sub Worksheet_Calculate()
If Range("A3") = 1 Then
Rows("3:3").Select
Selection.Rows.autofit
Range("A3").Select
End If
End Sub
In worksheet A3 = B1
Problem is, that this code doesn't work, it means that row doesn't change it size.
I have worksheet in different languages, and because of it expressions has different amount of letters, so if in english expression is only 5 letters long, than in other language it can be 10 or even more letters long.
I cant use shrink to fit command because then some of expressions could be so small that no one could see them.
So what I did, was that I changed all cells format to Wrap text. Now all text will be normal size but some times I need to change some of rows hight.
Of course I could to so, that all rows are always in maximum hight, but then sheet doesn't look so well.
So basically I need somekind of vba code, which would automaticly change all rows hights after I had choosed langugage.
How to do so?
I tried to make a VBA code which would autofit all rows in worksheet.
I wrote this kind of code:
Private Sub Worksheet_Calculate()
If Range("A3") = 1 Then
Rows("3:3").Select
Selection.Rows.autofit
Range("A3").Select
End If
End Sub
In worksheet A3 = B1
Problem is, that this code doesn't work, it means that row doesn't change it size.
I have worksheet in different languages, and because of it expressions has different amount of letters, so if in english expression is only 5 letters long, than in other language it can be 10 or even more letters long.
I cant use shrink to fit command because then some of expressions could be so small that no one could see them.
So what I did, was that I changed all cells format to Wrap text. Now all text will be normal size but some times I need to change some of rows hight.
Of course I could to so, that all rows are always in maximum hight, but then sheet doesn't look so well.
So basically I need somekind of vba code, which would automaticly change all rows hights after I had choosed langugage.
How to do so?