Resize row height vba excel

Solved
Des auvergnats -  
 MedBad -
Hello,
I would like to resize the height of a row in Excel using VBA, but I can't find a solution. If anyone has an idea, thank you in advance!

Configuration: Windows XP

2 réponses

koji56 Posted messages 35 Status Membre 6
 
Sub Macro() Feuil1.Rows("1:1").RowHeight = 15 End Sub


In a module, enter this program (to be modified according to the sheet and the row). You can then call this program using a button, depending on what you want to do exactly. With this example, you modify the height of row 1 of Sheet1 of your workbook, setting it to a height of 15.
5
Des auvergnats
 
Thank you very much, it works very well; however, I can't replace the line number with a variable.
0
koji56 Posted messages 35 Status Membre 6
 
There is actually no need for quotes in the parentheses of Rows.
You can do it directly like this:

Sub Macro4()
For i = 1 To 10
Feuil1.Rows(i).RowHeight = 15
Next i
End Sub
0