title: Max value in Worksheet
body: <p>Need some help finding the max value in a worksheet,</p>
  
  <p>I tried with range:</p>
  
  <pre><code>Dim maxNumber As Double 
  maxNumber = Application.WorksheetFunction.Max(Range("A1:B5"))
  </code></pre>
  
  <p>Except I don't want it to stop at B5, I want it to go through the whole Worksheet.</p>
  
  <p>So I found that "XFD1048576" symbolizes the last cell of a worksheet:</p>
  
  <pre><code>Dim maxNumber As Double 
  maxNumber = Application.WorksheetFunction.Max(Range("A1:XFD1048576"))
  </code></pre>
  
  <p>Just wondering now if there's a more elegant solution, anything to replace "XFD1048576", or simply writing better code.</p>