title: Excel VBA rowheigt from value in range
body: <p>I have an Excel-Sheet with values in column D.
  I would like to set the row height in relation to the value of cell D of each row.
  Values in D are small %-values like 0.0593 %, except of the first (D4 = 31 %) and last (D92 = 40 %)</p>
  
  <p>To get the small values at a reasonable height I'd like to multiply them with 10'000 - but there comes the problem with the 409 max height.</p>
  
  <p>I have a script that works until it comes to the high values so I tried a if formula. But to be frankly: I have no Idea what I am doing here... I copied it together.</p>
  
  <p>So the problems: working only in the range of D5-D91 and if a value should go over 409 give him something like 15px.</p>
  
  <p>Thanx for your Help!</p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  
    Dim i As Long
    For i = 4 To Cells(Rows.Count, 1).End(xlUp).Row - 1
        With Cells(i, 4)
                      If .Cells(i, 4).Value * 10000 &gt; 409 Then
              Rows(i).RowHeight = 12
                      Else
              Rows(i).RowHeight = Cells(i, 4).Value * 10000
              End If
        End With
     Next i
  
  End Sub
  </code></pre>